CSC2259 Discrete Structures Konstantin Busch Louisiana State University
CSC-2259 Discrete Structures Konstantin Busch Louisiana State University K. Busch - LSU 1
Topics to be covered • • Logic and Proofs Sets, Functions, Sequences, Sums Integers, Matrices Induction, Recursion Counting Discrete Probability Graphs K. Busch - LSU 2
Binary Arithmetic Decimal Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Numbers: 9, 28, 211, etc Binary Digits: 0, 1 (also known as bits) Numbers: 1001, 11100, 11010011, etc K. Busch - LSU 3
Binary Decimal 1001 9 K. Busch - LSU 4
Binary Addition 1001 (9) + 1 1 (3) -----1100 (12) Binary Multiplication 1001 (9) x 1 1 (3) -----1001 + 1001 ----11011 (27) K. Busch - LSU 5
Binary Logic AND OR x y z 0 0 0 0 1 1 1 0 0 1 1 1 1 NOT x z 0 1 1 0 Gates AND OR K. Busch - LSU NOT 6
An arbitrary binary function is implemented with NOT, AND, and OR gates … OR NOT AND K. Busch - LSU 7
Propositional Logic Proposition: a declarative sentence which is either True or False Examples: Today is Wednesday Today it Snows 1+1 = 2 1+1 = 1 H 20 = water K. Busch - LSU (False) (True) 8
We can map to binary values: True = 1 False = 0 Propositions can be combined using the binary operators AND, OR, NOT Example: K. Busch - LSU 9
Implication True False True False True x implies y “You get a computer science degree only if you are a computer science major” You get a computer science degree You are a computer science major K. Busch - LSU 10
Bi-conditional True False False True x if and only if y “There is a received phone call if and only if there is a phone ring” There is a received phone call There is a phone ring K. Busch - LSU 11
Sets Set is a collection of elements: Real numbers R Integers Z Empty Set Students in this room K. Busch - LSU 12
Basic Set Operations Subset 1 2 3 4 5 Union 3 1 2 4 5 K. Busch - LSU 13
Intersection 3 1 2 4 5 Complement universe K. Busch - LSU 14
De. Morgan’s Laws K. Busch - LSU 15
Inclusion-Exclusion A B C K. Busch - LSU 16
Powersets Contains all subsets of a set Powerset of A K. Busch - LSU 17
Counting Suppose we are given four objects: a, b, c, d How many ways are there to order the objects? a, b, c, d b, a, c, d a, b, d, c b, a, d, c … and so on K. Busch - LSU 18
Combinations Given a set S with n elements how many subsets exist with m elements? Example: K. Busch - LSU 19
Sterling’s Approximation K. Busch - LSU 20
Probabilities What is the probability the a dice gives 5? Event set = {5} Sample space = {1, 2, 3, 4, 5, 6} K. Busch - LSU 21
What is the probability that two dice give the same number? Event set = {{1, 1}, {2, 2}, {3, 3}, {4, 4}, {5, 5}, {6, 6}} Sample Space = {{1, 1}, {1, 2}, {1, 3}, …. , {6, 5}, {6, 6}} K. Busch - LSU 22
Randomized Algorithms Quicksort(A): If ( |A| == 1) return the one item in A Else p = Random. Element(A) L = elements less than p H = elements higher than p B = Quicksort(L) C = Quicksort(H) return(BC) K. Busch - LSU 23
Graph Theory San Francisco 800 700 2000 miles 1500 miles 300 1500 Las Vegas 1500 Chicago 1000 1500 1000 2000 Los Angeles Boston New York 800 Atlanta 700 Baton Rouge 1500 Miami K. Busch - LSU 24
Shortest Path from Los Angeles to Boston 1500 2000 800 1500 1000 700 1500 1000 300 Boston 800 1000 700 2000 1500 Los Angeles K. Busch - LSU 25
Maximum number of edges in a graph with nodes: Clique with five nodes K. Busch - LSU 26
Other interesting graphs Trees Bipartite Graph K. Busch - LSU 27
Recursion Sum of arithmetic sequence Basis Sum of geometric sequence Basis K. Busch - LSU 28
Fibonacci numbers Basis Divide and conquer algorithms (Quicksort) K. Busch - LSU 29
Proof Techniques Induction Contradiction Pigeonhole principle K. Busch - LSU 30
Proof by Induction Prove: Induction Basis: Induction Hypothesis: Induction Step: K. Busch - LSU 31
Proof by Contradiction is irrational Suppose ( and have no common divisor greater than 1 ) m 2 is even 2 = 4 k 2 n 2 = 2 k 2 K. Busch - LSU m=2 k m is even n is even Contradiction 32
- Slides: 32