Saturday, 1 December 2012

Last but not the least ----- ALGORITHM solving

We have learn the how computer processes an algorithm. We also learnt how important it is to come up with an algorithm that can be interpreted by the computer. And the here is the how I have solved the paper folding problem that was mentioned in class:

1. Understanding the problem:
For the paper folding problem, we are suppose to figure out a specific algorithm that can be used as a cookbook for any logical person to proceed with no problem. Devising the steps to fold paper is not that hard but here it is:
-----------------------------------------------------------------------------
1st. take out a strip of paper and hold its left side with you left thumb and index figure.
2nd. hold the paper stripes right side with you right thumb and index figure.
3rd. fold in half by folding the paper from your left hand to the right.
4rd. Now repeat this steps from 1-3 according to how many folds that's needed. And see the pattern that was created after that much fold.
-----------------------------------------------------------------------------

2. Devising a plan: 
Now to figure out the pattern that will be created from the number of folds. There are one most easy way to go about it, which is just proceed the steps with the algorithm stated above for how many number of folds. However, a normal, healthy person can probably only fold up to 6-7 folds(unless you are Arnold schwarzenegger).
Therefore, to come up with a more efficient methods I will try to record down the different folding patterns and examine them to see if there is specific pattern that can be found.

3. Carrying out the plan:
Record of different folds: (D for down and U for up)
1 fold: D
2 folds: UDD
3 folds: UUDDUDD
4 folds: UUDUUDDDUUDDUDD
-------------------------------------------------------------------------
Now after organizing it a bit, I am starting to see a pattern:
                     D
                   UDD
              UUDDUDD
     UUDUUDDDUUDDUDD
I can see the center pattern will always be D. Let's call its left sides pattern as L-SIDE and the right sides pattern as R-SIDE. So we can see the fold pattern on the R-SIDE will be always the previous fold pattern. And the L-SIDE will be just the same previous fold pattern with its fold's centre pattern changed to D instead.

Thus: I can predict the next pattern will be:
5 folds:   UUDUUDDUUUDDUDDDUUDUUDDDUUDDUDD


4. Looking back:
There are many algorithms used by computer. You can say every computer action is dominated by an algorithm. And by combining all these different algorithm, we are capable of making computer process complicated tasks. However, not all algorithms are solvable in this world. Therefore, we still have much to learn to improve the computer we have today.