[r-t] Notating jump changes (was Blue line (/grid) generators / Jump Changes)
Don Morrison
dfm at ringing.org
Wed May 20 02:11:16 UTC 2015
>
> On Tue, May 19, 2015 at 3:53 AM Alexander Holroyd <holroyd at math.ubc.ca>
> wrote:
> > Good point. I guess the "2" is needed.
>
> With that emendation, that interior places that are being made must
> always be specified explicitly just as with ordinary place notation, I
> *think* I see an algorithm for turning such extended place notation
> into a permutation. It is rather more complex than I'd like, but I
> think it works.
>
> Given how helpful Ander's recent comments have been, I'm afraid I'm
> going to bother you all again, and ask anyone interested to pass their
> eyes over this and tell me if it seems right to you. It's complicated
> enough it seems unlikely I haven't gotten something wrong. And if
> anyone sees an easier way to do this, please do speak up!
>
> We're starting from a fragment of place notation representing a
> single, possibly jump, change, at stage N which is not a cross. It is
> a non-empty string of place names and parenthesized pairs of place
> names: (xy) meaning the bell at position x ends up in position y.
> Leading and/or lying places may or may not have been elided.
>
> b is an array of length N, all of whose elements are initialized to
> null. The Boolean expression "x in b" means that some element of b is
> equal to x.
>
> First we define a little helper operation, insert(i, j), which inserts
> i into position j of b:
>
> | insert(i, j):
> | if i in b or b[j] != null
> | error
> | b[j] = i
>
> Then we walk over the fragment of extended place notation. For every
> bare place x (that is, place x being made) we call
>
> | insert(x, x)
>
> and for every parenthesised expression (xy) we call
>
> | insert(x, y)
>
> Next we figure out whether or not we need to add an implied leading
> place:
>
> | if b[0] = null
> | if 0 in b
> | insert(1, 0)
> | else if 1 in b
> | insert(0, 0)
> | else
> | m = the smallest k such that b[k] != null or k in b
> | if m is odd
> | insert(0, 0)
> | else
> | insert(1, 0)
>
> Now the main loop:
>
> | for k from 1 to N-2
> | if b[k] = null
> | if k-1 not in b
> | insert(k-1, k)
> | else
> | insert(k+1, k)
>
> Finally the last position, which may need to have an implied lying
> place:
>
> | if b[N-1] = null
> | if N-2 not in b
> | insert(N-2, N-1)
> | else
> | insert(N-1, N-1)
>
> I *think* that produces the right result, if there is one, and
> otherwise signals an error.
>
> Can anyone see anything wrong with this? Can anyone see an easier way
> to do it?
>
>
>
> --
> Don Morrison <dfm at ringing.org>
> "Bishops move diagonally. That's why they often turn up where the
> kings don't expect them to be." -- Terry Pratchett, _Small Gods_
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://bellringers.net/pipermail/ringing-theory/attachments/20150520/82f51b02/attachment-0004.html>
More information about the ringing-theory
mailing list