Sunday, 5 October 2014

CSC165 week 4

In this week lecture we learn about the implication and dis junction, mixed quantifiers, and also learn how to reach a proof for each case. It is pretty tough for me compare to other mathematical subject but I really enjoy the process of logical thinking. There is a problem that we have to solve for this week, it is about folds a paper strip across ,and counts the order of the lines before fold it again.
Here is the data that i records during the class:
Fold times:                      Order:∨ means fold it down;∧ means upwards
1:∨
2:∨∨∧
3:∨∨∧∨∨∧∧
4:∨∨∧∨∨∧∧∨∨∨∧∧∨∧∧
What i find the pattern is that the under line parts :
1:                              ∨
2:                           ∨∨∧
3:                     ∨∨∧∨∨∧∧
4:        ∨∨∧∨∨∧∧∨∨∨∧∧∨∧∧

They have relationship shows ∨∧ repeat in a specific rule, number of ∨∧ repeat = 2^(n-1), where the n is means the number of folding time. And the following pattern that is not been underlined are pattern from the previous line , for example the part is not been underlined are exactly same as the line 2 form. Therefore we can write in the Python and testing the concept:
In the Python we assuming the line_1 = ['∨', ' ','∧',' ' ], L= n * line_1 to and set the range to (1,len(line_1 * n ),2) .  Now we can using L[i]=L=[i-1] in order to merger the lists, and also getting pattern as we predicted.

No comments:

Post a Comment