We did a class problem in lecture last Friday. The problem was to predict the ups and downs of paper after folding it from right to left a number of times. I thought about it but I'm not sure, but I tried. I will write about my guess at a solution.
First I thought that the middle crease is always down. My partner was writing out the ups and downs after folding it 1, 2, 3, 4, 5 times. He tried to find a pattern, and I tried to help, but when I thought about it, it was hard. But I noticed that there are always an odd number of creases.
Then professsor Heap said to think recursively and symmetrically. I'm still kind of confused about recursive, but I know what symmetric means. I thought I should define my functions and domain. My high school math teacher said that's a good place to start when you don't know what to do. So I stated my knowns and unknowns.
P is a function. P(m, n) is 1 when the nth crease from the left after m folds is up, and -1 when the nth crease from the left after m folds is down. m is the number of folds, starting from 1. n is the index of a crease, in [1, 2^m)
2^(m - 1) is the middle crease. Let's say k = 2^(m - 1) because it's easier. I think P(m, k) = -1. The first fold makes the middle crease which is always down.
Then I thought, for n in [1, k), we are looking at the creases on the left side. The left side is always flat on the table, so it is like folding a new piece of paper. So P(m, n) = P(m - 1, n).
Then I thought about the other side. For n in (k, 2^m), we are looking at the creases on the right side. When folded, the right side is like the left side, but upside down. While it is upside down, the right side has the same folds as the left side. But when you flip it back, all the ups become downs, and all the downs become ups. The creases on the left side become the creases on the right side. So P(m, n) = -P(m, 2^m - n)
I tried to write a python program to try it because sometimes professor Heap does python in class. But I kept getting a typeerror. But I wanted to write about my thoughts because I thought it was pretty cool. But I might be wrong. Together, I have
P(m, n) =
-1 if n = 2^(m - 1)
P(m - 1, n) if n in [1, 2^(m - 1))
-P(m, 2^m - n) if n in (2^(m - 1), 2^m)
Trying some simple values seems to work. P(1, 1) = -1. P(2, 1) = -1. P(2, 2) = -1. P(2, 3) = 1. P(3, 1) = -1, P(3, 2) = -1, P(3, 3) = 1, P(3, 4) = -1, P(3, 5) = -1, P(3, 6) = 1, P(3, 7) = 1.
No comments:
Post a Comment