### (no subject)

Here is a tiny javascript thing that reacts a little if you mouseover. I just threw it together in an hour after waking up wondering what sort of shapes you'd get if you randomly assigned directions to lattice points and followed them. It's regrettably slow in firefox although speedy enough in chrome. Dunno why.

The javascript toy has a built-in bias towards paths going down and to the right, just because I wanted more visual interest than the short paths that came out of the uniform distribution over the four directions. I kind of wonder what happens in higher dimensions. My thoughts tend toward think along the paths 'upstream': suppose I've got some vertex in my hand and I want to extend the path by finding some one of my neighbors that's pointing at me. What are the odds there's at least one? (This line of thinking is just an approximation, ignoring the possibility that it turns out to actually be a node that's already in my 'downstream')

Well, in an n-dimensional square lattice, I've got 2n neighbors, and each one of them picks one of 2n directions at random. Each one has a 1 in 2n chance of pointing towards me. The chance of none of them pointing towards me is (1 - 1/2n)^(2n) which is 1/e in the limit. So my gut says that things don't actually spiral out of control in higher dimensions. I guess I could do an experiment with hash functions or something...

---

Huh! It empirically seems like the average time until you hit a cycle in n dimensions is exactly 2n.

2 4.8731

3 6.459

4 8.3785

5 10.2061

6 12.1667

7 14.2784

8 15.7819

9 17.8955

10 20.4033

11 22.0062

12 24.0271

13 26.1572

14 27.9639

15 30.0764

16 31.7978

17 34.1895

18 35.5108

The javascript toy has a built-in bias towards paths going down and to the right, just because I wanted more visual interest than the short paths that came out of the uniform distribution over the four directions. I kind of wonder what happens in higher dimensions. My thoughts tend toward think along the paths 'upstream': suppose I've got some vertex in my hand and I want to extend the path by finding some one of my neighbors that's pointing at me. What are the odds there's at least one? (This line of thinking is just an approximation, ignoring the possibility that it turns out to actually be a node that's already in my 'downstream')

Well, in an n-dimensional square lattice, I've got 2n neighbors, and each one of them picks one of 2n directions at random. Each one has a 1 in 2n chance of pointing towards me. The chance of none of them pointing towards me is (1 - 1/2n)^(2n) which is 1/e in the limit. So my gut says that things don't actually spiral out of control in higher dimensions. I guess I could do an experiment with hash functions or something...

---

Huh! It empirically seems like the average time until you hit a cycle in n dimensions is exactly 2n.

2 4.8731

3 6.459

4 8.3785

5 10.2061

6 12.1667

7 14.2784

8 15.7819

9 17.8955

10 20.4033

11 22.0062

12 24.0271

13 26.1572

14 27.9639

15 30.0764

16 31.7978

17 34.1895

18 35.5108

**( Collapse )**