introduction to discrete systems - university of...
TRANSCRIPT
![Page 1: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/1.jpg)
1
CSE 2500
Introduction to Discrete Systems
Jinbo Bi Department of Computer Science & Engineering
http://www.engr.uconn.edu/~jinbo
![Page 2: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/2.jpg)
The Instructor • Ph.D. in Mathematics • Working experience
• Siemens Medical Solutions • Department of Defense, Bioinformatics • UConn, CSE
• Contact: [email protected], 486-1458 (office) • Research Interests:
• Genetic analysis of complex human disease • Intelligent online counseling systems to monitor and regulate heavy
alcohol use among college students • Clinical decision support systems – Easy Breathing for asthma
care
subtyping GWAS
Color of flowers
Cancer, Psychiatric
disorders, …
http://labhealthinfo.uconn.edu/EasyBreathing
![Page 3: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/3.jpg)
3
Today
Organizational details Purpose of the course Material coverage Section 1.1 of the text
![Page 4: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/4.jpg)
4
Course Syllabus
Go over syllabus carefully, and keep a copy of it
Course website
http://www.engr.uconn.edu/~jinbo/Fall2012_discrete_math.htm
![Page 5: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/5.jpg)
5
Textbook
Attending the lectures is not a substitute for reading the text Lectures merely highlight some examples Read the text and do as many exercises as humanly possible
![Page 6: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/6.jpg)
6
Slides
We may not have slides for each lecture (only the first lecture has a full set of slides) If a lecture uses slides, they will be available right after lecture at HuskyCT
![Page 7: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/7.jpg)
7
Marking Scheme
6 out of 7 assignments 30% (the lowest mark assignment will be dropped)
2 Midterm: 40% 1 Final Exam: 30% Curved
Curve is tuned to the final overall distribution No pre-set passing percentage
![Page 8: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/8.jpg)
8
In-Class Participation
Finding errors in my lecture notes Answering my questions Asking questions on the material
![Page 9: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/9.jpg)
9
Assignments
6 out of 7 will count Each will have 4-10 problems from the textbook Solutions will be published at HuskCT after due day Each assignment will be given 1 week, but some may be 2-weeks
![Page 10: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/10.jpg)
10
Some Arithmetic Suppose you are running late and the due date is near… If you don’t hand in just one assignment:
No problem (only 6 out of 7 count) If you don’t hand in two assignments:
Lose 30 / 6 = 5% of the final mark Suppose you copy it from a friend:
We will most likely detect it You will lose 100% of the final mark Your friend will be prosecuted as well Plus: suspension, possible deportation, etc.
The choice is always yours…
![Page 11: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/11.jpg)
11
Questions?
![Page 12: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/12.jpg)
12
Why This Course?
Relation to real life:
Algorithm correctness ~ programming, reverse-engineering, debugging
Propositional logic ~ hardware (including VLSI) design
Sets/relations ~ databases (Oracle, MS Access, etc.)
Predicate logic ~ Artificial Intelligence, compilers
Proofs ~ Artificial Intelligence, VLSI, compilers, theoretical physics/chemistry
![Page 13: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/13.jpg)
13
Code Correctness
Millions of programmers code away daily… How do we know if their code works? How can we find the bug if it does not work
![Page 14: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/14.jpg)
14
Argument #1
All men are mortal Socrates is a man Therefore, Socrates is mortal
![Page 15: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/15.jpg)
15
Argument #2
Nothing is better than God A sandwich is better than nothing Therefore, a sandwich is better than God
![Page 16: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/16.jpg)
16
Validity
An argument is valid if and only if given that its premises hold its conclusion also holds So…
Socrates argument: Valid or Invalid? Sandwich argument: Valid or Invalid?
![Page 17: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/17.jpg)
17
How can we tell ?
Common sense? Voting? Authority? What is valid argument anyway? Who cares? ???
![Page 18: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/18.jpg)
18
CSE 2500
Logic : a formal way to assess a validity of an argument Can prove theorems in a semi-automatic fashion Can verify given proofs that an argument is valid
![Page 19: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/19.jpg)
19
Material Coverage Chapter 1: speaking mathematically Chapter 2: The logic of compound statements
Chapter 3: The logic of quantified statements
Chapter 4: elementary number theory Chapter 5: mathematical induction, Recursion
Chapter 6: set theory Chapter 7: functions Chapter 8: Relation Chapter 10: Graphs (potential)
![Page 20: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/20.jpg)
20
Questions?
![Page 21: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/21.jpg)
21
Arguments in Puzzles
The Island of Knights and Knaves
Never lie
Always lie
![Page 22: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/22.jpg)
22
Example #1
You meet two people: A, B A says:
I am a Knave or B is a Knight.
Who is A? Who is B?
![Page 23: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/23.jpg)
23
Solution The original statement can be written as: S = X or Y X = “A is a Knave” Y = “B is a Knight” Suppose A is a Knave Then S must be false since A said it Then both X and Y are false If X is false then A is not a Knave Contradiction : A cannot be a Knave and not a Knave ! So A must be a Knight So S is true and X is not true Thus, to keep S true Y must be true So B is a Knight too
![Page 24: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/24.jpg)
24
How about…
You meet just one guy : A A says:
“I’m a Knave!”
Who is A?
![Page 25: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/25.jpg)
25
Features Of An Argument arguments involve things or objects things have properties arguments consist of statements statements may be composed an argument starts with assumptions which create a context. each step yields another statement which is true, within its context. arguments may contain sub-arguments it is absurd for a statement to be both true and false
![Page 26: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/26.jpg)
26
Formalization
Why formalize? to remove ambiguity to represent facts on a computer and use it for proving, proof-checking, etc. to detect unsound reasoning in arguments
![Page 27: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/27.jpg)
27
Graphically…
![Page 28: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/28.jpg)
28
Logic
Mathematical logic is a tool for dealing with formal reasoning
Logic does: Assess if an argument is valid/invalid
Logic does not directly: Assess the truth of atomic statements
![Page 29: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/29.jpg)
29
Differences Logic can deduce that:
Edmonton is in Canada given these facts:
Edmonton is in Alberta Alberta is a part of Canada
and the definitions of: ‘to be a part of’ ‘to be in’
Logic knows nothing of whether these facts actually hold in real life!
![Page 30: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/30.jpg)
30
Questions?
![Page 31: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/31.jpg)
31
Mathematical Symbols
Simplest kind of math logic Dealing with:
Propositions: X,P,Q,… each can be true or false Examples: P=“I’m a knave” Q=“He is a knight” Connectives: &, v, , , ~, …
connect propositions: X v Y
![Page 32: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/32.jpg)
32
Connectives
Different notation is in use We will use the common math notation:
~ not V or (non-exclusive!) and implies (if … then …) if and only if ∀ for all ∃ there exists
![Page 33: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/33.jpg)
33
Formulae
A statement/proposition: true or false
Atomic: P, Q, X, Y, …
Unit Formula: P, ~P, (formula), …
Conjunctive: P & Q, P & ~Q, …
Disjunctive: P v Q, P v (P & X),…
Conditional: P Q
Biconditional: P Q
![Page 34: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/34.jpg)
34
Determining Truth of A Formula
Atomic formulae: given Compound formulae: via meaning of the connectives Suppose: P is true Q is false How about: (P v Q) Truth tables
![Page 35: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/35.jpg)
35
Truth Tables
Suppose: P is false Q is false X is true How about:
P & Q & X P v Q & X P & Q v X
![Page 36: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/36.jpg)
36
Precedence
~ highest & v , lowest Avoid confusion - use ‘(‘ and ‘)’:
P & Q v X (P & Q) v X
![Page 37: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/37.jpg)
37
Parenthesizing
Parenthesize & build truth tables Similar to arithmetics:
3*5+7 = (3*5)+7 but NOT 3*(5+7) A&B v C = (A&B) v C but NOT A&(B v C)
So start with sub-formulae with highest-precedence connectives and work your way out Let’s do the knave & knight problem in TT
![Page 38: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/38.jpg)
38
TT for K&K S = X or Y X = “A is a Knave” Y = “B is a Knight” A B S X Y X v Y Absurd ------------------------------------------------------------------------------ Knave Knave false true false true yes Knave Knight false true true true yes Knight Knave true false false false yes Knight Knight true false true true no
![Page 39: Introduction to Discrete Systems - University of …jinbo/courses/DiscreteMath_Fall2012/CSE2500... · Introduction to Discrete Systems Jinbo Bi Department of Computer Science & Engineering](https://reader030.vdocuments.us/reader030/viewer/2022021718/5b9149ef09d3f277288b4ba2/html5/thumbnails/39.jpg)
39
Questions?