Proofs. Hellish to learn but essential.
Ever want to prove something to be true in all cases? Well you can happily write "2+2=4 so that is proven" and you'll be pretty bang on! But in the realm of computers you rarely get something so simple. A function is meant to take in a MASSIVE AMOUNT of data and process it in a particular way- the particular way being something you hope it does! So in proofs one of the main things you test for (generally) is that your program actually is saying or doing something that IS TRUE. Actually lemme wind back a bit. Here we're going to speak of proving more simple math, before I make a giant post on proving algorithms using proofs (my fave has to be induction....). Here we have a whole wack of proofs but nice thing is once you get the gist of it that problem solving method applies VERY generally and widely! 1: Proof by assuming something in an implication (I'll write more on these later!) such as assume p is actually true in p=>q! Here you basically assume one part of the statement is true and then work further on from there to prove that the statement is true! But be cautious as you need to keep strongly in mind that you ASSUMED P IS TRUE FOR THE PROOF. Once the proof is done? NOPE! Can't make that leap. 2: Proof by taking essentially the negative of the opposite (contrapositive). The contrapositive means basically the exact same thing as the original. So prove this? Prove the original! Funny how that works! 3: Proof by division into components. Lets say I want to prove something... it may be far easier to divide what I am proving into several subsections or groups and then prove for each case! 4: Proof by contradiction! Essentially here you want to say "the sky is not blue" and prove that it is wrong (assuming that the sky IS blue of course!). So if you prove that the WRONG statement that you are 'tryinjg to prove' is NOT proveable or has some logical hiccup... bam! You got proof for the original being TRUE! 5: Proving statmenets that are "if and ONLY if" meaning both have to be true simultaneously! This takes parts! Such as prove that one is true for the other and then that the other is true for the other using proof (1) or (2) I just described above! PHEW, that one is a doozey.












