Monday, April 8, 2013

Problem solving episode: paper folding

Problem:
When a strip of paper is continuously folded left-end over right, determine the relation between the number of folds and the number of creases and the position of the creases.

ie. When the paper is folded 8 times, what are the position of the creases?


Data: 
0 Folds = no crease 
1 fold = 1 crease (D) 
2 Folds = 3 creases (U D D) 
3 Folds = 7 creases (U U D D U D D) 
4 Folds = 15 creases (U U D U U D D D U U D D U D D)


Plan: 
Try to find the pattern to how the position of the crease relate to the number of creases and also make connection between number or creases and number of folds.

Solving:
 
Step 1: look back at the data and see if anything obvious pops up
 F= 0 c = 0
 F= 1 c = 1
F= 2 c = 3
 F= 3 c = 7 
 F= 4 c = 15 
I can derive a formula such that number of crease = 2( number of crease (number of folds - 1)) + 1
 
say for example, folds = 3
# crease = 2( number of crease ( 3-1) )+1 =  2 ( 3 ) + 1 = 7
thats consistent with our data!
 
Step 2: try to figure out the position of crease
 
looking back at data:
1 ) (D)
2) (U D D)
3) (U U D D U D D)
4) (U U D U U D D D U U D D U D D)
 
- it looks like the pattern is that 
 
1 ) (D)
2) (U D D)
3) (U U D D U D D)
                                                  4) (U U D U U D D D U U D D U D D) 
we can simply say that from 1 to 2, we add U to the left of D(bolded) and D to the right of D(bolded)
from 2 to 3, we add U to left of U(red) and D to right of U(red). and then we do the same to the red D on the right. -> adding U to left and D to right to each.
 
 To find the position in the proceeding steps, one adds a U to the left and a D to the right of the positions in the present step while ignoring positions that have previously had a U added to their left and a D to their right. 

Done :)
 
 

Sunday, March 31, 2013

It's coming to an end.

Today is the last day of March, which means end of school is in a week. There is excitement and disappointment. Excitement is that summer is coming. Disappointment is that CSC104 is also ending.

After all the DrRacket programming exercises we did in class and in tutorial, i think i have a solid understanding of the Racket language and how to use them to manipulate numbers and images.

Project is due soon and it tests our knowledge about recursive functions such as the sierpenski triangle. I was trying to move onto the higher level programming by trying to complete the bonus question. However, i come across the unfamiliar racket language and i was not able to finish that. Because using different language changes the structure of defining functions and things like that, i think i am going to ask Danny for help sometime next week.

Thursday, March 14, 2013

Term test 2 done!

    Woot! another term test done and all that's left is finals! I am so exciting. 

    Test 2 is about the same difficulty as i expected and there was one question that i have no idea how to do. It was the one where it asks why doesn't computer engineer integrate RAM in CPU. I honestly have no idea why even after the test. I searched it up but there was no answer for so i don't know. 

    The rest of the test is pretty straight-forward. The last part consists of recursion knowledge which we just learnt not long ago. It gives the function condition that would reverse the order of the string. It is kind of like the rot13 function we did in class a while ago. 


Saturday, March 2, 2013

Project # 1

     It's about time to start on project #1. I think that this project is a good place to use all the fundamental racket techniques we learned. I don't know how much time this is going to take me, but I have decided to do this on my own because i will get more experience by doing that. It is great practice and will eventually help me throughout the course.
   
     There is one question that i wish to ask the TAs. For the SLOG problem solving episode, what exactly are we expected to do? I've heard from a friend of mine that we are supposed to write out an algorithm for solving a problem like the paper folding problem we did in the beginning of the year.

    All in all, I am enjoying the course very much. ^__^

Thursday, February 21, 2013

Reading Break

    Before the reading break, I got my midterm back and I was satisfied with my marks. I was actually kind of surprised for the high mark I received. Anyways, Dr.Racket is still fun to play with. I've been playing around with Aggregates the past couple days and it was quite interesting. I wish that we can do more advanced Dr.Racket coding so we can make like an app or program or something like that.

    Another thing that I have been working on is the wikipedia project. I have selected 2-3 articles that I like to edit and have been reading over the instruction on how to do so. I'm not sure if I can do this, but can somebody tell me if I am able to edit 2 wikipedia articles? Because each one of the article I selected is kind of short and the editing process isn't going to be very long, so I am thinking I should do 2 wikipedia articles to compensate for the short length of each articles. Overall, I will be spending roughly 4 hours of work in the final part of this project and I really do hope that no one edits my articles before I start to work on them.

Friday, February 8, 2013

Midterm 1

    Finally, the first midterm was taken care of!

    The test came a little more difficult than I expected it to be. The first part tested our knowledge about computing machine. However, what was asked was not in the note so I couldn't give a standard answer. The only thing I recalled reading that was relevant was why transistors were better than vacuum tubes. I hope that the TA marking my test will be kind enough to give me part marks for my answer. :(

    The Dr.Racket part was a fair game because the format of the question was very similar to old test. 

    I hope I can do better on my second midterm and maybe a little more studying may help me. 

Friday, February 1, 2013

Getting the hang of Dr.Racket

     After using Dr.Racket for a couple weeks, I'm confident that I can move into more in-depth programming, which we did cover in class. Just a lecture from today, we learned how to use the built in function "big-bang" to create animation. In the end, we used it to build an animation that is similar to the ticking of a clock.
     However, there is something annoying about my Dr.Racket. It keeps on crashing while I am coding my big-bang function. I am pretty sure my coding is correct but Dr.Racket just won't accept it. It kind of disappointed me a little but I figured I can always save my work before running it.
     So far, in term of quiz, I have been doing pretty good as they are quite straight forward if you do the tutorial exercise ahead of time. As the test is coming up, I am not too worry about the programming part but more so on the history of computing machine. There aren't many notes in detail explaining different machines in different eras. I just hope that Prof.Heap will post the past tests ASAP so I can get a feel of what the test is going to be like and prepare while I can.