MATHEMATICS

Jumat, 18 Februari 2011

Creating a fractal with Excel or Calc

If you have Excel 2010 then do the following, otherwise apply the equivalent code / options for your spreadsheet.

Create a new workbook
Make sure that zeros are displayed as whitespace:
- \File\Options
- Select 'Advanced' on left sidebar
- ( Look for 'Display options for this worksheet: Sheet1' )
- When found deselect 'Show a zero in cells that have a zero value'
Set the column-width to the first 130 rows or so to about 3.0

Now apply some values to the following four cells.
A1: p ( any prime ), use a small prime, for example 3.
C3: 1
A4: =A3+1 ( not necessary, but shows interesting properties )
In C4 we implement the Pascal recurrence modulo a prime
C4: =MOD(C3+B3;*A*1) ( replace * with dollar sign conflict with MathJax )
Now you have to do some copying and pasting:
- you have to copy this cell at least 128 cells to the right
- copy the contents of row 4 at least 127 times

If you have done this correct you will see patterns like this:
Mod 2, zoom 30%

Mod 3, zoom 30%

Mod 7, zoom 30%
It will be interesting to see what happens if you try mod p to a power, i.e. 4, 8 and 16, or mod 9.

It should be possible to control graphics at the pixel level with Mathematica, I might give it a try.

It was OU course M381 ( which I am on at the moment ) that gave me the idea to look at the Pascal triangle modulo a prime because one of the topics in M381 is the Fibonacci series modulo a prime. The Pascal Triangle and the Fibonacci series are definitely among my favourite mathematical objects. If I had to choose I would say the PT of course, because the Fibonacci series is neatly contained within it. What is not? One might ask.

Tidak ada komentar:

Posting Komentar