PASCAL'S TRIANGLE
Z<-PASCAL N;T
T<-1 & Z<-""
AA: ->(0=N--)/0 & Z<-Z,:(-36-4*rT)m72t8zT & T<-(0,T)+T,0 & ->AA
$ PASCAL 9
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
1 7 21 35 35 21 7 1
1 8 28 56 70 56 28 8 1
When the values are coloured according to whether they are even or
odd you get a series of increasing triangles called the Sierpinski
gasket.
This may be generated by a random walk in the complex plane:-
Z[n+1] <- (Z[n]+X[n])/2
where X[1],X[2],... are random variables, each taking one of
the three values a,b,c with probability 1/3. Here (a,b,c) are the
vertices of a triangle.
The generation of this triangle is very easy to rotate. It is
also possible to generalise the procedure to four or more points.
The formula should be:-
Z[n+1]<-(Z[n]+(n-2)*X[n])/(n-1)
Here X is a random variable which takes one of n complex values
with probability 1/n.When done on a computer the random walks are completely determined. each X[n] is determined by its precedessor. The pair (Z,X) satisfies an equation (Z,X)<-F(Z,X). This is an example of a dynamical system. The random variable X is often generated by modular arithmetic.
