Saturday, November 1, 2014

How do I Count?

Counting is, by far, the most difficult task I've had to do this week.

You see, when you are given a program, you can evaluate how efficient it is by counting the number of "steps" it takes to accomplish something.

So if I gave you a program that said something like:

x = "Hello world"
print(x)

Then you would have two steps. One step to initialize x and another step to print x. Simple right?

Not if we're in CSC165.

Now what if we have a for loop that loops over a list? Well, in this case, we would have to count the number of steps inside the for loop and then multiply that by the number of loops. So if we put our "Hello world" program above into a for loop, we would have something like 2n steps where n is the number of times we loop!

Which isn't bad. Until you start proving Big-Oh, the upper bound. Just looking at the proof is giving me a headache. Sometimes I feel like the proofs work along the lines of "Step 1, step 2, [insert magic here], conclusion."

Looks like I'll have to  review the course notes. The notes seem to make sense so far!

I feel like this person's view on proofs is the same resounding view as all of us.
http://lukasfrantzkecsc165.blogspot.ca/2014/10/slog-csc165-week-6.html

No comments:

Post a Comment