Friday, March 29, 2013

Counting sheep doesn't work.


Week 11

Man, this week's topic on the Halting problem truly is confusing. Making  a program that can predict when all other programs in the universe could halt, gee whoever makes that, we should make a new religion for them and bow down to them as a new God, but I don't think that'll be happening anytime soon...

Anddd back on to Earth the class lectures' examples were sort of confusing it first, but I guess it's the idea of being a self referential you think of:


immediately makes it so. Imagining how many times the functions call themselves over and over...a belly button in a belly button in a belly button in a belly button in a -oh look there's lint- return 42 (the meaning of life lolwut...) -is a little strange.

But then I reread the code again for the navel_gaze example and found that it's actually quite simple, it's just an infinite loop which never actually reaches the return 42 line, so when you call it upon itself a check for H(navel_gaze, navel_gaze), and of course using H() on another 'inner' execution of navel_gaze never actually halts, so an infinite loop occurs for the while H() line in the 'outer' function of navel_gaze, which then infinitely loops again. In Python though, which stops first? The inner while loop of navel_gaze in the H(navel_gaze_, navel_gaze) line or the outer while loop?

The hash function used in halt_0 has a bit strange because it was my first time seeing it in Python. The Python dictionary structure uses the hash function right? I almost forgot what hash-values and tables were and it was a huge reminder that I need to review my Java again because it'll be introduced in my second year of CS... (argh the amount of syntax...)

What I'm wondering though is how exactly we're going to be tested on the Halting problem on the final exam for this course. Will there be something simple as determining whether a program's counting is 1-1 or onto, or would it be something a bit more difficult, like predicting how a program will run another inner function and reduce to that same inner function(like the daunting fifth question on A3)?
For now, though I guess I'll refer to the course notes pdf on how to format a proof for it...

Week 10

*warning I typed an essay*

*Gets back T2
Yepp, I make careless mistakes
I COULDN'T EVEN NEGATE THE STATEMENT PROPERLY...
OF COURSE DIVISION PRODUCES A NON-NATURAL NUMBER
WRRRRRRRRRRRRRRYYYYYYYYYYYY


As for week 10, I finally get to see the guts and details of how math is directly involved in piecing together a program's complexity and giving a visual idea of how it's run time may be optimized further. The proofs have now begun to finally pick up on math, involving our first-year calculus concepts and leading more into the gory details of how a proof can work and it's beginning to make more and more sense, but of course this is only first year. Some of the proofs have become daunting to understand with the big theta formula introduced but I'll just have to get used with imagining multiple graphs I guess...

 I'm still wondering how I should go about choosing my courses for CS in my second and future years to come, because it becomes split between technical CS or theoretical...

I really do like math and have sat with it in front of my face every Saturday for 10 years, trying out different math textbooks to a few university handbooks and some geometric proofs, but my relentless habit for making careless mistakes is always getting in my way -____________________________- for getting those good marks in my classes. I've always made a tonne of mistakes in those Saturday math classes, they served content that was sometimes a few years ahead of my elementary school curriculum, then I'd do the assignments, probably get like only 4 our 20 of the questions right, but then run back and correct them all ASAP always trying, and I still don't ever hate math. I have a long long record of silly mistakes -_-, no matter how serious I am, they seem to be resurging back up again in my school work though...

*Every time I look at my T1*: "Wah-ok was I drunk?.. How did I not get this? -.-"

*T2*: "...How did I..."
*-5 marks

*If you really think you're going to die reading this, skip this section and scroll past the ===*

========================================================================

BECAUSE I'M PRETTY SURE THAT I CAN...
ASSUME THAT Logics is pretty hard to do
               THEN ASK: should I work with CS's practical/technical uses instead?

               THEN ASK: (it's-first-year-I-did-not-take-a-lot-of-courses-to-say-that-I-want-to-major-or-
                                      specialize-in-say-CS-or-STATS-and-I-have-to-decide-on-a-POSt-soon)

               THEN CONSIDER (the job profits and omg-am-I-going-to-die-in-the upper-years?  yay-I-will-          
                                               be-broke-after-graduation)

                 # lose marks for this proof structure
                THEN ASK: Will I have a cubicle job? How fun are cubicle jobs? *twitches
THEN unresolved answer

========================================================================

So uh what are some  further applications of CS that use intensive logics and proofs, aside from dealing with a program's efficiency?

What careers does it typically involve?

Any hints as to which 165-ish courses are the most valuable to take for second year?
(CSC236/240 introduces Computation Theory, CSC 260 sounds interesting?)
(p.s .financial math and biology scare me...... Economics sounds... ergh...and I'm a very visual person)

... versus the courses focussing on CS's practical uses, or related courses outside of the CS department(example: Math)

Since this kind of logic deals with efficiency, that butts in a lot with managing databases and information, is there going to be a lot of hardware courses that I'll have to take(nuoooooooooooooooooooooooo)?

If you can recall...what were some mixes of courses past students took that were logic intensive?



Congrats you survived.
Thanks for reading my huge ugly essay.

Saturday, March 16, 2013

Week 9

There was not too much difficulty with this week's content.

Today's midterm was not too bad, as much as the first midterm, it actually seemed a bit easier.
Though, because of this week's midterm I am a bit behind on week 9's lectures on proofs with  Big-Oh
notation. I think the best way for me to catch up and understand them quickly will be a visual approach using graphs and a little review on the definition of limits in calculus will help.


Sunday, March 10, 2013

Week 8

Alrighty uh so far this week's Assignment 2 was actually pretty bearable, more so than the first one. The only difficult thing was how to solve the actual proof itself, but I think my group did pretty well on it except for the last question.

We were debating really loudly on how to answer question 6 and in the end they picked a sample number representative of real numbers, like 2, to prove that all elements of a set of real numbers have that property that they proved o_O.  Usually when you prove a statement that says "for all x in set  S", you usually prove it by using and manipulating variables representative of the elements of the set rather than picking actual values right? Because there is a possibility that the number you chose just happens to have with a unique weird property that may not be a good representation of all other elements in that set..


Aaaaaaaaaand I just read the sample solution to question number 6... Exactly what I thought..
 HOLY CRAP
WHY DOESN'T ANYONE LISTEN TO ME OMG THIS HAPPENED FOR THE FIRST ASSIGNMENT TOO
I HAD THE EXACT SAME PROOF WRITTEN DOWN
I WAS RIGHT AJKSDHFDJKFHJKASDHFJKASDHJFKHADSJCNJKSDBNCJKNXZMVNCZXMNVJCMKSNZVJKNDFVJKFASNVJNADKVNJWDKNVJNASFVKBNFJV JKASDNVJDVJADIVJBIKDFVBHFBHVBDHDBVHBDHVBHDBVBHDSbvHBDSZBCXHBHCBXDHVBHCHDBHCBHBVBdhVBDHbVHDBHVBHDBVHCBJDSbHDBSHBDSJVCHSDBVHSDVJDS

*flips table
ARGHHHHHHHHHHHH


Uhh... so yah complexity of a program...
What is a Loop Guard(LG) in a program? (Refer to Friday, March 8th lecture)
When writing an equation like 4n^3 + 3n^2 + 2n + C, where C is a constant,
How do you "overestimate" to rewrite this expression in Big-O Notation?
I know you take the term with the greatest degree, but in the last slide of Friday's lecture, why is the coefficient of this term the sum of the coefficients of the other terms? I believe it resulted in O(n^3), I'm not entirely sure, the slides are not exactly up yet..

Week 7

I had a math exam during this week.
 I did not encounter much difficulty in the course material for the week. The proof solving-techniques re pretty straight forward. It just requires practice to get better at it.

As for Big-O notation it seems alright to understand right now, but I think I will need to read up a few extra articles on Wikipedia and Google to review how it works. The concept was explained quickly in CSC 108, but was not focussed as much- probably because it is an introductory course for teaching fundamental programming concepts for beginners. The in-class examples in CSC 165 make so much more sense in explaining the Big-O notation, because its application is shown based on code which is a lot more easier than just explaining it without using a clear model as they did in CSC 108, then again it was an introductory course...

In short, not much problems were encountered during the week...