Class Notes (839,387)
Computing (443)
CISC 121 (27)
Lecture

# 6.2.pdf

1 Page
127 Views

Department
Computing
Course Code
CISC 121
Professor
Robin W Dawes

This preview shows half of the first page. Sign up to view the full page of the document.
Description
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

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

Unlock Document

Unlock to view full version

Unlock Document
Me

OR

Join OneClass

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

Join to view

OR

By registering, I agree to the Terms and Privacy Policies
Just a few more details

So we can recommend you notes for your school.