1 csc-2259 discrete structures konstantin busch louisiana state university k. busch - lsu
TRANSCRIPT
![Page 1: 1 CSC-2259 Discrete Structures Konstantin Busch Louisiana State University K. Busch - LSU](https://reader030.vdocuments.us/reader030/viewer/2022033023/56649ef65503460f94c0a5fe/html5/thumbnails/1.jpg)
1
CSC-2259 Discrete Structures
Konstantin Busch
Louisiana State University
K. Busch - LSU
![Page 2: 1 CSC-2259 Discrete Structures Konstantin Busch Louisiana State University K. Busch - LSU](https://reader030.vdocuments.us/reader030/viewer/2022033023/56649ef65503460f94c0a5fe/html5/thumbnails/2.jpg)
Topics to be covered
• Logic and Proofs• Sets, Functions, Sequences, Sums• Integers, Matrices• Induction, Recursion• Counting• Discrete Probability• Graphs
K. Busch - LSU 2
![Page 3: 1 CSC-2259 Discrete Structures Konstantin Busch Louisiana State University K. Busch - LSU](https://reader030.vdocuments.us/reader030/viewer/2022033023/56649ef65503460f94c0a5fe/html5/thumbnails/3.jpg)
Binary Arithmetic
3
Decimal Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Binary Digits: 0, 1
Numbers: 9, 28, 211, etc
Numbers: 1001, 11100, 11010011, etc
(also known as bits)
K. Busch - LSU
![Page 4: 1 CSC-2259 Discrete Structures Konstantin Busch Louisiana State University K. Busch - LSU](https://reader030.vdocuments.us/reader030/viewer/2022033023/56649ef65503460f94c0a5fe/html5/thumbnails/4.jpg)
4
Binary
1001
91821202021 0123
Decimal
9
K. Busch - LSU
![Page 5: 1 CSC-2259 Discrete Structures Konstantin Busch Louisiana State University K. Busch - LSU](https://reader030.vdocuments.us/reader030/viewer/2022033023/56649ef65503460f94c0a5fe/html5/thumbnails/5.jpg)
5
Binary Addition Binary Multiplication
1001 (9)+ 1 1 (3)------1100 (12)
1001 (9) x 1 1 (3) ------ 1001+ 1001--------- 11011 (27)
K. Busch - LSU
![Page 6: 1 CSC-2259 Discrete Structures Konstantin Busch Louisiana State University K. Busch - LSU](https://reader030.vdocuments.us/reader030/viewer/2022033023/56649ef65503460f94c0a5fe/html5/thumbnails/6.jpg)
6
x
yz
xy
z x zGates
AND OR NOT
x y z
0 0 0
0 1 0
1 0 0
1 1 1
AND
Binary Logic
x y z
0 0 0
0 1 1
1 0 1
1 1 1
OR
x z
0 1
1 0
NOT
K. Busch - LSU
![Page 7: 1 CSC-2259 Discrete Structures Konstantin Busch Louisiana State University K. Busch - LSU](https://reader030.vdocuments.us/reader030/viewer/2022033023/56649ef65503460f94c0a5fe/html5/thumbnails/7.jpg)
7
An arbitrary binary function is implementedwith NOT, AND, and OR gates yxxxf n ),,,( 21
y
1x
2x
2x
nx…
NOT AND
OR
K. Busch - LSU
![Page 8: 1 CSC-2259 Discrete Structures Konstantin Busch Louisiana State University K. Busch - LSU](https://reader030.vdocuments.us/reader030/viewer/2022033023/56649ef65503460f94c0a5fe/html5/thumbnails/8.jpg)
8
Propositional Logic
Proposition: a declarative sentence which is either True or False
Examples:Today is Wednesday (False)Today it Snows (False)1+1 = 2 (True)1+1 = 1 (False)H20 = water (True)
K. Busch - LSU
![Page 9: 1 CSC-2259 Discrete Structures Konstantin Busch Louisiana State University K. Busch - LSU](https://reader030.vdocuments.us/reader030/viewer/2022033023/56649ef65503460f94c0a5fe/html5/thumbnails/9.jpg)
9
Propositions can be combined usingthe binary operators AND, OR, NOT
We can map to binary values:True = 1False = 0
))(()( cbaqp Example:
K. Busch - LSU
![Page 10: 1 CSC-2259 Discrete Structures Konstantin Busch Louisiana State University K. Busch - LSU](https://reader030.vdocuments.us/reader030/viewer/2022033023/56649ef65503460f94c0a5fe/html5/thumbnails/10.jpg)
10
True True True
True False False
False True True
False False True
x y yxImplication
x implies y
“You get a computer science degree only if you are a computer science major”
You get a computer science degree:x:y You are a computer science major
yx
K. Busch - LSU
![Page 11: 1 CSC-2259 Discrete Structures Konstantin Busch Louisiana State University K. Busch - LSU](https://reader030.vdocuments.us/reader030/viewer/2022033023/56649ef65503460f94c0a5fe/html5/thumbnails/11.jpg)
11
True True True
True False False
False True False
False False True
x y yxBi-conditional
x if and only if y
“There is a received phone call if and only if there is a phone ring”
:x:yThere is a received phone call
There is a phone ring
yx
K. Busch - LSU
![Page 12: 1 CSC-2259 Discrete Structures Konstantin Busch Louisiana State University K. Busch - LSU](https://reader030.vdocuments.us/reader030/viewer/2022033023/56649ef65503460f94c0a5fe/html5/thumbnails/12.jpg)
12
Sets
Set is a collection of elements:
Real numbers R
Integers Z
Empty Set
Students in this room
K. Busch - LSU
![Page 13: 1 CSC-2259 Discrete Structures Konstantin Busch Louisiana State University K. Busch - LSU](https://reader030.vdocuments.us/reader030/viewer/2022033023/56649ef65503460f94c0a5fe/html5/thumbnails/13.jpg)
13
Subset }5,4,3,2,1{}4,2{
Basic Set Operations
2
4
1
3
5
Union }5,4,3,2,1{}5,4,2{}3,2,1{
241
3
5
K. Busch - LSU
![Page 14: 1 CSC-2259 Discrete Structures Konstantin Busch Louisiana State University K. Busch - LSU](https://reader030.vdocuments.us/reader030/viewer/2022033023/56649ef65503460f94c0a5fe/html5/thumbnails/14.jpg)
14
Intersection }2{}5,4,2{}3,2,1{
241
3
5
Complement }5,3,2{}4,1{
}5,4,3,2,1{universeK. Busch - LSU
![Page 15: 1 CSC-2259 Discrete Structures Konstantin Busch Louisiana State University K. Busch - LSU](https://reader030.vdocuments.us/reader030/viewer/2022033023/56649ef65503460f94c0a5fe/html5/thumbnails/15.jpg)
15
DeMorgan’s Laws
BABA
BABA
K. Busch - LSU
![Page 16: 1 CSC-2259 Discrete Structures Konstantin Busch Louisiana State University K. Busch - LSU](https://reader030.vdocuments.us/reader030/viewer/2022033023/56649ef65503460f94c0a5fe/html5/thumbnails/16.jpg)
16
Inclusion-Exclusion
A B
C
|CBA|
||||||
|||||| ||
CBCABA
CBACBA
K. Busch - LSU
![Page 17: 1 CSC-2259 Discrete Structures Konstantin Busch Louisiana State University K. Busch - LSU](https://reader030.vdocuments.us/reader030/viewer/2022033023/56649ef65503460f94c0a5fe/html5/thumbnails/17.jpg)
17
Powersets
Contains all subsets of a set
}}3,2,1{},3,1{},3,2{},2,1{},3{},2{},1{,{Q
}3,2,1{A
||2|| AQ
Powerset of A
K. Busch - LSU
![Page 18: 1 CSC-2259 Discrete Structures Konstantin Busch Louisiana State University K. Busch - LSU](https://reader030.vdocuments.us/reader030/viewer/2022033023/56649ef65503460f94c0a5fe/html5/thumbnails/18.jpg)
18
Counting
Suppose we are given four objects: a, b, c, d
How many ways are there to order the objects? 4321!4
a,b,c,db,a,c,da,b,d,cb,a,d,c … and so on
K. Busch - LSU
![Page 19: 1 CSC-2259 Discrete Structures Konstantin Busch Louisiana State University K. Busch - LSU](https://reader030.vdocuments.us/reader030/viewer/2022033023/56649ef65503460f94c0a5fe/html5/thumbnails/19.jpg)
19
CombinationsGiven a set S with n elementshow many subsets exist with m elements?
)!(!
!
mnm
n
m
n
Example: 3)!23(!2
!3
2
3
}3,1{},3,2{},2,1{ }3,2,1{SK. Busch - LSU
![Page 20: 1 CSC-2259 Discrete Structures Konstantin Busch Louisiana State University K. Busch - LSU](https://reader030.vdocuments.us/reader030/viewer/2022033023/56649ef65503460f94c0a5fe/html5/thumbnails/20.jpg)
20
Sterling’s Approximation
n
e
nnn
2!
K. Busch - LSU
![Page 21: 1 CSC-2259 Discrete Structures Konstantin Busch Louisiana State University K. Busch - LSU](https://reader030.vdocuments.us/reader030/viewer/2022033023/56649ef65503460f94c0a5fe/html5/thumbnails/21.jpg)
21
Probabilities
What is the probability the a dice gives 5?
Sample space = {1,2,3,4,5,6}
Event set = {5}
K. Busch - LSU
6
1
space sample of Size
setevent of Size{5})obability(Pr
![Page 22: 1 CSC-2259 Discrete Structures Konstantin Busch Louisiana State University K. Busch - LSU](https://reader030.vdocuments.us/reader030/viewer/2022033023/56649ef65503460f94c0a5fe/html5/thumbnails/22.jpg)
22
What is the probability that two dice give the same number?
22
Sample Space = {{1,1},{1,2},{1,3}, …., {6,5}, {6,6}}
Event set = {{1,1},{2,2},{3,3},{4,4},{5,5},{6,6}}
K. Busch - LSU
36
6
space sample of Size
setevent of Sizenumber}) {sameobability(Pr
![Page 23: 1 CSC-2259 Discrete Structures Konstantin Busch Louisiana State University K. Busch - LSU](https://reader030.vdocuments.us/reader030/viewer/2022033023/56649ef65503460f94c0a5fe/html5/thumbnails/23.jpg)
23
Randomized Algorithms
Quicksort(A):If ( |A| == 1)
return the one item in AElse p = RandomElement(A) L = elements less than p H = elements higher than p B = Quicksort(L) C = Quicksort(H) return(BC)
K. Busch - LSU
![Page 24: 1 CSC-2259 Discrete Structures Konstantin Busch Louisiana State University K. Busch - LSU](https://reader030.vdocuments.us/reader030/viewer/2022033023/56649ef65503460f94c0a5fe/html5/thumbnails/24.jpg)
24
Graph Theory
K. Busch - LSU
Miami
Atlanta
New York
BostonChicago
Baton Rouge
Las Vegas
San Francisco
Los Angeles
2000 miles1500 miles
1500
15001000
2000
700
1500
300
800
700
1500
1000
1000
800
![Page 25: 1 CSC-2259 Discrete Structures Konstantin Busch Louisiana State University K. Busch - LSU](https://reader030.vdocuments.us/reader030/viewer/2022033023/56649ef65503460f94c0a5fe/html5/thumbnails/25.jpg)
25
Shortest Path from Los Angeles to Boston
K. Busch - LSU
Boston
Los Angeles
20001500
1500
15001000
2000
700
1500
300
800
700
1500
1000
1000
800
![Page 26: 1 CSC-2259 Discrete Structures Konstantin Busch Louisiana State University K. Busch - LSU](https://reader030.vdocuments.us/reader030/viewer/2022033023/56649ef65503460f94c0a5fe/html5/thumbnails/26.jpg)
26
Maximum number of edges in a graphwith nodes:
22
)1(
)!2(!2
!
2
2 nnnn
n
nn
Clique with five nodes
5n10edges
n
K. Busch - LSU
![Page 27: 1 CSC-2259 Discrete Structures Konstantin Busch Louisiana State University K. Busch - LSU](https://reader030.vdocuments.us/reader030/viewer/2022033023/56649ef65503460f94c0a5fe/html5/thumbnails/27.jpg)
27
Other interesting graphs
Bipartite Graph
Trees
K. Busch - LSU
![Page 28: 1 CSC-2259 Discrete Structures Konstantin Busch Louisiana State University K. Busch - LSU](https://reader030.vdocuments.us/reader030/viewer/2022033023/56649ef65503460f94c0a5fe/html5/thumbnails/28.jpg)
28
Recursion
)1()( nfnnf
1)1(2)( nfnf
Basis1)1( f
1)1( f
Basis
nnnf )1(4321)( Sum of arithmetic sequence
Sum of geometric sequence)1(3210 22222)( nnf
K. Busch - LSU
![Page 29: 1 CSC-2259 Discrete Structures Konstantin Busch Louisiana State University K. Busch - LSU](https://reader030.vdocuments.us/reader030/viewer/2022033023/56649ef65503460f94c0a5fe/html5/thumbnails/29.jpg)
29
nn
fnf
2
2)(
)2(1)( nfnfnf
1)1( f
1)1(,0)0( ff
Fibonacci numbers
Basis
Divide and conquer algorithms (Quicksort)
K. Busch - LSU
![Page 30: 1 CSC-2259 Discrete Structures Konstantin Busch Louisiana State University K. Busch - LSU](https://reader030.vdocuments.us/reader030/viewer/2022033023/56649ef65503460f94c0a5fe/html5/thumbnails/30.jpg)
30
Induction
Contradiction
Pigeonhole principle
Proof Techniques
K. Busch - LSU
![Page 31: 1 CSC-2259 Discrete Structures Konstantin Busch Louisiana State University K. Busch - LSU](https://reader030.vdocuments.us/reader030/viewer/2022033023/56649ef65503460f94c0a5fe/html5/thumbnails/31.jpg)
31
2)1(
)(
nn
nf
Proof by Induction
Induction Basis:2
)11(11)1(
f
Induction Hypothesis:2
)1()1(
nnnf
2)1(
22)1(
)1()(2
nnnnnn
nnfnnf
Induction Step:
)1()( nfnnf Prove:
K. Busch - LSU
![Page 32: 1 CSC-2259 Discrete Structures Konstantin Busch Louisiana State University K. Busch - LSU](https://reader030.vdocuments.us/reader030/viewer/2022033023/56649ef65503460f94c0a5fe/html5/thumbnails/32.jpg)
32
Proof by Contradiction
2 is irrational
Supposen
m2 ( and have no common
divisor greater than 1 )
m n
2
2
2n
m m2 is even m is even
2 n2 = 4k2 n2 = 2k2 n is even
m=2k
ContradictionK. Busch - LSU