The main topic for today's lecture was how to look at a problem before starting to try and solve it.
- write down information given
- relate this to another problem
- look at question in parts
- resolution to assumption instead of assumption to resolution
The paper folding exercise helped further this concept. By writing down the the folds in the notation of "U for up and D for down",
1
|
D
|
2
|
D D U
|
3
|
D D U D D U U
|
4
|
D D U D D U U D D D U U D U U
|
After thinking about the process in which we were told to fold the paper, I was able to recognize a pattern. Since we were always told to fold the paper down the middle, then there must be a correlation if not hint that pointed us towards the middle of the up-and-down list.
Here is what I found:
Folds
|
Pattern
|
1
|
D
|
2
|
D D U
|
3
|
D D U D D U U
|
4
|
D D U D D U U D D D U U D U U
|
After analyzing the data, I noticed that the second half of the folding process is a carbon copy of the line above with the addition of an extra D in the middle, separating the inverted first half.
In total, my group was able to find 3 different patterns in this exercise; however, only 2 of them were we able to write a python function to represent our findings. Referencing to http://brendannealslog165.blogspot.ca/. From this pattern, we were able to generate a python code that embodied the entirety of the folding pattern that we noticed in class.
From this we were able to realize that the only way for us to write the code was to follow the problem solving steps. Had we not realized that the wording in the question, we would not have discovered the hint about folding the paper down the middle and finding the middle of the pattern.
No comments:
Post a Comment