Tuesday 2 December 2014

Other Slogs that helped me

Some slogs that helped me a lot to think about my own slog and helped me understand concepts better were:

1. http://csc165f.blogspot.ca/ 

This slog had many images and diagrams in order to describe the concepts which helped a lot. A lot of example proofs which made this slog good to clarify any concepts. I found a lot of concepts in this course very difficult but this slog describes the problems really well and shows many visual images that helps me especially as a visual learner.

2. http://olivertanslog.blogspot.ca/

I found that this slog explained concepts really well. Especially the problem solving model for penny piles was very helpful to gain insight from and see what others views may be on the same problem solving model that I did in order to see differences of view and approach on the same problem. This would help me become a better problem solver looking at different ways others go about solving problems and critiquing my own work.

3. http://howdocomputer.blogspot.ca/

This slog was very interesting because it was a quite funny slog to read. It was interesting to read some of his posts such as "Real" python design recipe. I found that this slog put a lot of passion in to what they were learning which i could probably use a lot more for my own slog. Also to relate what i learned in this class to my own life and apply what i learned to solving problems that i may face day in and day out.

Saturday 29 November 2014

Week 11: Halting Problem and Diagonals

Hello Rod here,

This week we finished the halting problem and is also the last week before examinations. Mostly this week me and my group have been working on assignment 3 where we were working on things like the halting problem and whether a function has to be be in big oh or big omega of another function. From assignment 3 i'm learning a lot of things that I am sure will help me a lot on the exam.

This is going to be my final blog post. So good bye.

Saturday 22 November 2014

Week 10: Halting

Hello Rod here,

This week we were introduced to halting function. I was a little confused cause the halting problem seemed to be theoretical because apparently no one can program the halting function. I learned that we could prove this so through the navel_gaze function we were shown in lecture that only halts when the function halt, halts. And after we were asked if this was so, what would navel_gaze(navel_gaze) do? navel_gaze will halt only if navel_gaze does not halt, which is a contradiction.

We were given assignment 3 today and there was a halting problem on it. I am hoping i will learn more about it halting when working on that problem.

I also watched this video on halting which helped me understand: https://www.youtube.com/watch?v=92WHN-pAFCs

Saturday 15 November 2014

Week 9: Proofs of Big Oh and Big Omega

Hello Rod here,

This week we started doing proofs of big omega and big oh. Instead of just proving that an a equation is in big oh/ big omega of another equation, we started proving more complicated statements that required you to think a bit more.

For example one of the statements were is f,g are functions that take naturals and return real numbers larger than zero. Then if f is in big oh of g then that implies that g is in big omega. Prooving these statements required from me alot more thinking to be done instead of just trying to find and existing c and B just to prove that a statement is in big oh of another statement.

The proofs that we were learning this week are bit more challenging but I am certain most of my confusion will be cleared up when assignment 3 is released. Since the assignments in the past cleared up alot of things for me.

Friday 7 November 2014

Week 8: Big Oh and Big Omega and Penny Piles

Hello Rod here,

Big Oh and Big Omega
This week we continues on Big Oh and Big Omega. Tutorial helped out a lot this week when we went over counting steps in the algorithms we were given. Also the proofs for prooving the upper bound or lower bound of a equation is slowly becoming more clear. I'm still a little rough on this topic and I plan on looking over the course notes this weekend, because most of the concepts there are explained pretty well.

Penny Piles
This week I decided to do my upload my problem solving episode of Penny Piles.

Understanding the Problem:
When we were given the problem it was not clear at first so me and my partner began by reading the rules of the problem and what needed to be solved. In this case penny piles we were not convinced that you can get to every possible number (above zero, less than 64) by using the rules to divide 64. So we began by choosing numbers using the rules to get to that number. Eventually we found out that this was working for all the numbers whether odd or even.

Devise a Plan:
Once we noticed that we can get odd or even numbers we made a tree of possible results of following the steps, which helped us visualize the problem.

Carry out the Plan:
I figured to carry out the plan I wanted to write some python code, that takes as input the number of pennies you want to have in atleast one drawer and it outputs the steps you need to take in a list (this program assumes that all 64 pennies start off in the right drawer). This program is not the most efficient it could be simplified but this was the best I could get it too.

def penny_piles(pennies):
   
    steps = []
   
    operator = 'l'
   
    starting_pennies = 64
   
    while pennies != 64:
       
        if pennies > 32:
           
            pennies = 64 - pennies
           
            if operator == 'l':
                operator = 'r'
            elif operator == 'r':
                operator = 'l'
       
        pennies = pennies * 2
       
        steps = [operator] + steps
   
    if steps[0] == 'r':
        for i in range(len(steps)):
            if steps[i] == 'r':
                steps[i] = 'l'
            elif steps[i] == 'l':
                steps[i] = 'r'
   
    return steps
     
Look Back:
When writing the code I realized a lot of things that were flawed with my understanding of the problem. Such as the proper order of the commands. At first i got the program to work with returning the number of steps it took to solve the problem, then from there I modified it to return the actual steps needed to get the result.

P.s the last little block of code deals with the commands that start with command 'r'. It flips all the commands in order to get the same result but suffice that the first command has to be 'l' because all 64 pennies start in the right drawer.

Something I could also do is make it so that the user can input how many pennies they want to start off with, and i can make that a input variable rather than having it preset to 64.

Saturday 1 November 2014

Week 7: Big Oh and Big Omega

Hello Rod here,

This week we started Big Oh and Big Omega. We started this week by being given a linear search algorithm. We began counting the how many times the code would execute based off of the length of the search. Afterwards we were given the algorithm for insertion sort. We counted the steps of each line of code relative the length of the all the elements in the list and afterwards wrote a proof that the upper bound of insertion sort is no bigger than n squared. We did the same proof for the lower bound of big omega.

I found this week pretty challenging. I barely could follow along during the lectures. So my plan is that i'm just going to do what i usually do and read the course notes and try to understand the concepts on my own time. When it came to counting the steps of whatever algorithm i found it pretty clear. I just need to work on my proofs of big oh and big omega.

 

Friday 24 October 2014

Week 6: Sorting and Penny Piles

Hello Rod here,

This week we finished with proofs and we began talking about sorting. We were also assigned assignment #2 which will probably expand my ability to solve proofs, clearly and logically. Also today we were give another problem to solve, which was called Penny Piles.

Sorting
I am pretty glad we are starting sorting algorithms because it will give me more insight into the efficiency of certain sorting methods. I always heard of multiple sorting methods such as: bubble sort, insertion sort and selection sort but I am hoping to learn about the efficiency of some of these algorithms and the number of steps based on the situation.

Penny Piles
Today we started a problem called Penny Piles. Which was a problem along the lines of starting with a certain amount of pennies in one drawer and by using only 2 specific operations trying to get the one of the drawers to have a certain amount of pennies. How we went about solving this problem was by manually using the operations to get the desired result then afterwards we decided to make a tree of possibilities which made the operations more easier to visualize.

I look forward to continuing sorting algorithms more next week and the big oh.