ucsb-cs56-projects / cs56-discretemath-towers-sierpinski

-
1 stars 8 forks source link

Pascal's Triangle Swing GUI #35

Closed ShadowAries closed 10 years ago

ShadowAries commented 10 years ago

There are some interesting relationships between Pascal's Triangle, Sierpinski's Triangle, and the Tower of Hanoi.

For Pascal's Triangle, if every number were in a square and we were to shade in that square if the number were odd, we would observe a pattern that is the Sierpinski's Triangle. See link: https://www.zeuscat.com/andrew/chaos/pascal.sierpinski.clear.gif

Another relation in Pascal's Triangle is the sum of the terms in each row of the triangle. Simply put: the sum of the numbers in the nth row minus 1 == the total number of moves required to move an ordered stack of nth discs from one column to another. (Note: The starting row in Pascal's Triangle is the 0th row) Example: If we had 0 discs, we need 0 moves. ((1) - 1) If we had 1 disc, we need 1 move. ((1+1) - 1) If we had 2 discs, we need 3 moves. ((1+2+1) - 1) If we had 3 discs, we need 7 moves. ((1+3+3+1) - 1)

Create a Swing GUI to observe this phenomenon.

~estimated 250

jstaahl commented 10 years ago

This is a good issue.