Class Notes (839,387)
Canada (511,321)
Computing (443)
CISC 121 (27)


1 Page

Course Code
CISC 121
Robin W Dawes

This preview shows half of the first page. Sign up to view the full page of the document.
6.2 Thursday, February 14, 2013 8:34 AM Proof by induction for algorithms using 'course of values' induction: Strings in Python: With standard induction: Can be bounded by single quotes, double quotes or even triple quotes. Prove the statement E(n) is true for all n in a set Multiple things to start string because of apostrophes or quotation marks within strings… Base case: ex: "It's a sunny day" would work but 'It's a sunny day' would not ProofE(n)is truefor firstelement ex2: 'Tome said "Whyis there,"owlishly' Inductive step: ex3: 'He\'s here' Assume E(n) is true for n Prove that if E(n) is true, then E(n+1) is also true Strings are immutable. You cannot change a piece of a string without making a copy that has the wanted Course of values induction: changes Base case Assume E(n) is true for all elements of the set up to n Built in functions: \t = tab char \n = new line
More Less
Unlock Document

Only half of the first page are available for preview. Some parts have been intentionally blurred.

Unlock Document
You're Reading a Preview

Unlock to view full version

Unlock Document

Log In


Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.