Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Lecture 1: Introduction
Jittat Fakcharoenphol
There are a few things you have to learn and get used to.
a
c
c
b
The author claims that this program takes three variables a, b and
c and returns the largest one.
Do you believe the author of the code? Why?
Are we done?
Recall that we are left with the case that (1) n is not prime
The goals
Lets take a break and look back at what we are trying to do.
Original goal: To show that Algorithm CheckPrime2
is correct.
Current (sub) goal: Consider a positive composite n
show that 2 b n.
n.
that 2 b n.
2 b n,
where b = n/a.
Propositions1
I
I
I
Combining propositions
I
Disjunction: P Q (P or Q),
(True when at least one of P and Q is true)
Negation: P (not P )
(True only when P is false)
Truth tables
Q
T
F
T
F
P Q
T
F
F
F
P Q
T
T
T
F
P
F
T
Quick check 1
All prime numbers are larger than 0 and all natural numbers is
at least one.
Next lecture...