{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

19.pdf - CMPSCI 250 Introduction to Computation Lecture#19...

Info icon This preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
CMPSCI 250: Introduction to Computation Lecture #19: Proving the Basic Facts of Arithmetic David Mix Barrington 18 October 2017
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Proving the Facts of Arithmetic The Semiring of the Naturals The Definitions of Addition and Multiplication A Warmup: x: 0 + x = x Commutativity of Addition Associativity of Addition Commutativity of Multiplication Associativity and the Distributive Law
Image of page 2
Example: Making Change Suppose I have $5 and $12 gift certificates, and I would like to be able to give someone a set of certificates for any integer number of dollars. I clearly can’t do $4 or $11, but if the amount is large enough I should be able to do it. By trial and error (or more cleverly) you can show that $43 is the last bad amount.
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Example: Making Change Let P(n) be the statement “$n can be made with $5’s and $12’s”. I’d like to prove n: (n 44) P(n) by strong induction, starting with P(44). It’s easy to prove n: P(n) P(n+5), which helps with the strong inductive step, namely n: Q(n) P(n+1), where Q(n) is the statement i:((i 44) (i n)) P(i).
Image of page 4
Example: Making Change So let n be arbitrary and assume Q(n). If n 48, Q(n) includes P(n-4), and I can prove P(n+1) from P(n-4). But there are the cases of P(45), P(46), P(47), and P(48) which I have to do separately. One way to think of this is that with an inductive step of P(n) P(n+5), I need five base cases. If my sum proving P(n) had at least two $12’s, I could replace them with five $5’s and get the inductive step for an ordinary induction.
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
The Semiring of the Naturals The natural numbers form an algebraic structure called a semiring , obeying these axioms: 1. There are two binary operations called + and × . 2. Both operations are commutative . 3. Both operations are associative . 4. There is an additive identity called 0 and a multiplicative identity called 1. 5. Multiplication distributes over addition, so that u: v: w: u × (v + w) = (u × v) + (u × w).
Image of page 6
Details of the Semiring Axioms Commutativity means u: v: (u + v) = (v + u) and u: v: (u × v) = (v × u). Associativity means u: v: w:(u + (v + w)) = ((u + v) + w) and u: v: w: (u × (v × w)) = ((u × v) × w). Identity rules are u: (0 + u) = (u + 0) = u, u:(1 × u) = (u × 1) = u, and u: (0 × u) = (u × 0) = 0.
Image of page 7

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Clicker Question #1 Consider the operator on boolean values. Which of the following statements is true? (a) is commutative but not associative (b) is both commutative and associative (c) is neither commutative nor associative (d) is associative but not commutative
Image of page 8
is Associative?
Image of page 9

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern