Thursday, April 4, 2013

Weeks 11, 12:

WIth regards to project 2:
With Contrast.rkt --> This exercise was really easy to finish, but nonetheless interesting to work with.  Whilst in essence very similar to the ball.rkt work of project 1, this one had its tweaks that made it a bit more challenging, such as giving conditions, "equal?" (i still dont get them quite correctly, but if i have a lead, i can finish the problem).
With fractal.rkt ---> I was utterly lost for the first 30 mins of my time, as i did understood the check expects. Nonetheless after realising that the 2 values inside make-param corresponded to depth and height, i managed to understand how to make the definition. The rest was really simple, though i must remember about sub1 and add1, took me awhile to figure how to make the other sets of definitions to work.


With regards to the problem solving for slog: Quite simple, though i reckon i should have started earlier with this thing.

With regards to the course in general: Really enjoyable, and quite interesting for persons such as myself that had no idea on how to code in the first place.

Also, for some reason my drRacket crashes when trying to run a code.... i had some nasty cases of lost data.

Weeks 9 and 10


Things i enjoyed: working and finishing the wikipedia project. This proved to be a very satisfying work, and hopefully i did a decent job getting some of the translations correctly, as well as the appropriate citations.

Things that proved to be challenging: The midterm was kinda disappointing because I lost most my my marks   not on code problems, but rather on the other sections. Hence i must reinforce those areas when studying for the final exam. Also whilst recursion problems started reasonably easy, they proved to become quite challenging, in fact it took me a lot of time to understand the coding. Also migrating from intermediate student to full racket language was not an easy transition. Took me a while to realise why my check expects were not working.


Problem solving!


Penny piles problem:

Understand the Problem:

There are 2 drawers, left one with 64 pennies, and the right one without any:

The objective is to arrange the pennies so that one of them has 48 pennies, by following 2 steps:

L: If the left drawer has an even number of pennies, you may transfer half of them to the right drawer. If the left drawer has an odd amount of pennies, this step is not computable.

R: If the right drawer has an even number of pennies, you may transfer half of them to the left drawer. If the right drawer has an odd amount of pennies, this step is not computable.


Way of solving the question:

Draw a tree diagram on a piece of paper:
Pro: easy to sketch, easy to follow
Con: Takes a lot of time, especially for smaller odd values.



Solution:
1.     L -----à This leaves us with 32 pennies in each drawer
2.     L -----à This leaves us with 16 pennies in the left drawer and 48 in the right drawer.

Now, the question proceeds to ask to choose a value between 0 and 64, the chosen value will be the target value (x) to leave in a drawer.

Let x be 20:
1.     L -----à This leaves us with 32 pennies in each drawer.
2.     L -----à This leaves us with 16 pennies in the left drawer and 48 in the right drawer.
3.     R -----à This leaves us with 40 pennies in the left drawer and 24 on the right drawer
4.     L -----à This leaves us with 20 in the left drawer and 24 on the right drawer

Took more steps, but still more simple
Let’s try giving x the value of 4
1.     L -----à This leaves us with 32 pennies in each drawer.
2.     L -----à This leaves us with 16 pennies in the left drawer and 48 in the right drawer.
3.     L -----à This leaves us with 8 pennies in the left drawer and 56 on the right drawer
4.     L -----à This leaves us with 4 in the left drawer and 60 on the right drawer

Q&A:

Q: Are there any numbers in the range [0,64] that are impossible to reach?
A: Yes, the following values are impossible to reach: 0, several odd values such as 61 and 3.

Q: What about starting with a different number of pennies on the left drawer?
A: For numbers smaller than 64, each number will yield less possible numbers, whilst using any odd number will automatically make the problem void. With numbers larger than 64, some numbers may yield more numbers, but other like 70, will yield less.




Am i doing this right?

Friday, March 8, 2013

Week 7 and 8


Positively, I found to enjoy working on the wikipedia project. Though i found somewhat confusing on how to achieve the 3 marks available. Hopefully I did well.

With Regards to project 1:
With ball.rkt, i found it soemwhat easy to work with. In fact my only error while tweaking the work was trying to alter the code to make it work, rather than realize that my error was having a typo (> instead of <) Though in the end i made it work.
With enviroment.rkt, the work started easier than with ball rkt, but i confused several concepts when trying to define the last part of the code (the make-enviroment) I forgot how to sum and substract in racket ( the +/- comes before the functions)
Nonetheless I believe i managed to finish the code correctly

Overall everything positive.

Monday, February 25, 2013

Week 6


I'm very satisfied with the exam results. However, most of the mistakes committed were not due to difficulty, rather they were made due to carelessness (not being able to solve correctly a  simple equation, writing image -> picture instead of image -> image). I also feel satisfied with my grading on the 1st part of the Wikipedia exercise, though I'm a little confused on why i didn't get full marks on "suitable articles".

In any case, i found the slides on Bolean logic very easy to comprehend, as well as the slides on binary However, following the problems found in the tutorial sheet are becoming more difficult to follow at first due tot he amount of steps they take (specifically colors).

Friday, February 8, 2013

Week 4/5



The midterm was relatively easily, although some of the wordings were quite confusing to understand. part from that, using Dr Racket is getting slightly more complicated simply due to the increase of coding.
I really found very, interesting the Wikipedia articles work. Being able to contribute to a resource we constantly use, is in my opinion an excellent option. Though i certainly never expected to do so as a class work.

Another aspect i found interesting was the background history we learned about computers in generals, and how the logic engines in the early 1900s paved the way to the modern computer.

Tuesday, January 29, 2013


Week 3:

Things I found useful/ interesting:
The use of the define function to simplify large lines of code. On the other hand, the information provided by professor Heap on regards of the use of computers that could solve mathematical uncertainties such as Babbage difference engine.

Things I had trouble with:
Understanding the ‘Check expect’ function. My solution to this hindrance was reviewing the videos again, as well as reading the book Picturing programs. According to the information i could understand from the video, the check expect function will determine if the format of many lines of code are working as expected when typing them.