Download presentation
Presentation is loading. Please wait.
Published byHelen Berry Modified over 9 years ago
1
CS 490 Mathematical Logic, Combinatorics, Counting Arguments, Graph Theory, Number Theory, Discrete Probability, Recurrence Relation. Thao Tran.
2
Mathematical Logic Proposition and Logical Operators: Proposition and Logical Operators: Proposition: Proposition: A proposition is a sentence to which one and only one of the terms true o false can be meaningful applied. A proposition is a sentence to which one and only one of the terms true o false can be meaningful applied. Example: “four is even,” “43 >= 21” Example: “four is even,” “43 >= 21” Logical Operators: Logical Operators: Conjunction (And): If p and q are propositions, their conjunction, p and q (denoted p ^ q), is defined by: Conjunction (And): If p and q are propositions, their conjunction, p and q (denoted p ^ q), is defined by: p q p ^ q 0 0 0 0 1 0 1 0 0 1 1 1 Disjunction (Or): If p and q are propositions, their disjunction, p and q (denoted p v q), is defined by: Disjunction (Or): If p and q are propositions, their disjunction, p and q (denoted p v q), is defined by: p q p v q p q p v q 0 0 0 0 1 1 1 0 1 1 1 1
3
Mathematical Logic (cont.) Negation: Negation: if p is a proposition, its negation, not p, is denoted ~p and is defined by if p is a proposition, its negation, not p, is denoted ~p and is defined by p~p p~p 01 10 Conditional Operator( if…then): Conditional Operator( if…then): The conditional statement if p then q, denoted The conditional statement if p then q, denoted p --> q, is defined by pqp q 00 1 01 1 10 0 11 1 Example: Example: If I pass the final, then I’ll graduate. If I pass the final, then I’ll graduate.
4
Mathematical Logic( cont.) Truth table: Truth table:
5
Mathematical Logic (cont.) Tautology, Contradiction and Equivalent: Tautology, Contradiction and Equivalent: Tautology: An expression involving logical variables that is true in all cases of its truth table. Tautology: An expression involving logical variables that is true in all cases of its truth table. Example: p v ~p Example: p v ~p Contradiction: An expression involving logical variable that is false in all cases of its truth table. Contradiction: An expression involving logical variable that is false in all cases of its truth table. Example: p ^ ~p Example: p ^ ~p Equivalent: Let S be a set of propositions and let r and s be propositions generated by S. r and s are equivalent if r s is a tautology, denoted r s. Equivalent: Let S be a set of propositions and let r and s be propositions generated by S. r and s are equivalent if r s is a tautology, denoted r s. Example: p v q q v p Example: p v q q v p
6
Counting Principles It is frequently necessary to count how many ways certain choices can be made. It is frequently necessary to count how many ways certain choices can be made. Basic methods: Basic methods: Sum and product rules Sum and product rules Counting functions and sequences Counting functions and sequences Binomial theorem Binomial theorem
7
Sum and Product Rules Rule of sum: Rule of sum: The number of ways in which either of two mutually exclusive events can occur is equal to the sum of the number of ways in which each can occur separately. The number of ways in which either of two mutually exclusive events can occur is equal to the sum of the number of ways in which each can occur separately. Rule of product: Rule of product: The number of ways in which two independent events E 1 and E 2 can occur is the product of the numbers of ways in which E 1 and E 2 can occur separately. The number of ways in which two independent events E 1 and E 2 can occur is the product of the numbers of ways in which E 1 and E 2 can occur separately.
8
Sum and Product (cont.) Example: Example: Suppose that a system of car registrartion is adopted in which and allowable registration plate consists of 1,2, or 3 letters, followed by a number (not starting with 0) having the same number of digits as there are letters. How many possible registration are there? Suppose that a system of car registrartion is adopted in which and allowable registration plate consists of 1,2, or 3 letters, followed by a number (not starting with 0) having the same number of digits as there are letters. How many possible registration are there?
9
Sum and Product (cont.) Solution: Solution: (26 x 9) + (26 x 26 x 9 x 10) + (26 x 26 x 26 x 9 x 10 x 10) = 15879474 (26 x 9) + (26 x 26 x 9 x 10) + (26 x 26 x 26 x 9 x 10 x 10) = 15879474
10
Binomial Theorems Binomial Theorem Binomial Theorem (x+y) n = ∑ n r=0 ( n r ) x r y n-r (x+y) n = ∑ n r=0 ( n r ) x r y n-r Where : Where : ( n r ) =n!/(n-r)!r! ( n r ) =n!/(n-r)!r!
11
Power Set Definition: Definition: If A is any set, the power set of A is the set of all subsets of A, including the empty set and A itself. It is denoted P(A). If A is any set, the power set of A is the set of all subsets of A, including the empty set and A itself. It is denoted P(A). Example: Example: If A = {1, 2} then If A = {1, 2} then P(A) = { φ, {1}, {2}, {1,2}} P(A) = { φ, {1}, {2}, {1,2}} Formula: Formula: P(A) = 2 #A P(A) = 2 #A
12
Number Theory The natural numbers: The natural numbers: N = {0, 1, 2, 3, …} N = {0, 1, 2, 3, …} The integers: The integers: Z = {…, -2, -1, 0, 1, 2, …} Z = {…, -2, -1, 0, 1, 2, …} Z stands for Zahlen, meaning “numbers” in Geman Z stands for Zahlen, meaning “numbers” in Geman The rational numbers: The rational numbers: Denoted Q (quotient), comprises all those numbers that can be written in the form a/b, with a,b in Z Denoted Q (quotient), comprises all those numbers that can be written in the form a/b, with a,b in Z The real numbers: The real numbers: Denoted R: Denoted R: Example: √2, π Example: √2, π The complex numbers: The complex numbers: The set C of complex numbers is the set of all numbers of the form a+bi where a and b are real numbers and i 2 = -1 The set C of complex numbers is the set of all numbers of the form a+bi where a and b are real numbers and i 2 = -1 The reason for extending from R to C is to be able to solve all polynomial equation The reason for extending from R to C is to be able to solve all polynomial equation
13
Recurrence Relations Definition: Definition: Let S be a sequence of numbers. A recurrence relation on S is a formula that relates all but a finite number of terms of S to previous terms of S. That is, there is a k 0 in the domain of S such that if k > k 0, then S(k) is expressed in terms that preceed S(k). If the domain of S is {0, 1, 2…}, the terms S(0), S(1),…,S(k 0 ) are not defined by the recurrence formula. Their values are the initial conditions (or boundary conditions, or basis) that complete the definition of S. Let S be a sequence of numbers. A recurrence relation on S is a formula that relates all but a finite number of terms of S to previous terms of S. That is, there is a k 0 in the domain of S such that if k > k 0, then S(k) is expressed in terms that preceed S(k). If the domain of S is {0, 1, 2…}, the terms S(0), S(1),…,S(k 0 ) are not defined by the recurrence formula. Their values are the initial conditions (or boundary conditions, or basis) that complete the definition of S. Example: Example: The Fibonacci sequence: The Fibonacci sequence: F k = F k-2 + F k-1, k >= 2, F 0 =1, F 1 = 1 F k = F k-2 + F k-1, k >= 2, F 0 =1, F 1 = 1 This recurrence relation is called a second-order relation because F k depends on the two previous terms of F. This recurrence relation is called a second-order relation because F k depends on the two previous terms of F.
14
Recurrence Relations (cont.) Solving a recurrence relation: Solving a recurrence relation: Sequence are often most easily defined with a recurrence relation; however, the calculation of terms by directly applying a recurrence relation can be time consuming. Sequence are often most easily defined with a recurrence relation; however, the calculation of terms by directly applying a recurrence relation can be time consuming. Example: Example: Find recurrence relation for the sequence defined by: Find recurrence relation for the sequence defined by: D(k) = 5*2 k, k>=0 D(k) = 5*2 k, k>=0
15
Recurrence Relations (cont.) Answer: Answer: D(k) = 5*2 k = 2*5*2 k-1 = 2D(k-1) The relation is: D(k) – 2D(k-1) = 0 Initial condition D(0) = 5. Homogeneous recurrent relation: Homogeneous recurrent relation: An n th order linear relation is a homogeneous recurrence relation if f(k) = 0 for all k. For each recurrence relation An n th order linear relation is a homogeneous recurrence relation if f(k) = 0 for all k. For each recurrence relation S(k) + C 1 S(k-1)+…+C n S(k-n)=f(k) S(k) + C 1 S(k-1)+…+C n S(k-n)=f(k) The associated homogeneous relation is The associated homogeneous relation is S(k)+C 1 S(k-1)+ … + C n S(k-n)=0 S(k)+C 1 S(k-1)+ … + C n S(k-n)=0
16
Graph Theory Directed Graph: Directed Graph: Consist of a set of vertices, V, and a set of edges, E, connecting certain elements of V. Each element of E is an order pair. The first entry is the initial vertex of the edge and the second entry is the terminal vertex. Consist of a set of vertices, V, and a set of edges, E, connecting certain elements of V. Each element of E is an order pair. The first entry is the initial vertex of the edge and the second entry is the terminal vertex. Example: Example: Simple Graph & Multigraph: Simple Graph & Multigraph: Simple graph is one for which there is no more than one edge directed from any one vertex to any other vertex. All other graphs are called multigraph. Simple graph is one for which there is no more than one edge directed from any one vertex to any other vertex. All other graphs are called multigraph.
17
Graph Theory(cont.) Traversals: Traversals: Eulerian Graph: Eulerian Graph: Konigsberg Bridge Problem: Konigsberg Bridge Problem:
18
Graph Theory (cont.) Answer: Answer: A Eulerian path through a graph is a path whose edge list contains each edge of the graph exactly once. A Eulerian path through a graph is a path whose edge list contains each edge of the graph exactly once.
19
Graph Theory (cont.) Hamiltonian Graph: Hamiltonian Graph: A hamiltonian path through a graph is a path whose vertex list contains each vertex of the graph exactly once.A hamiltonian graph is a graph that possesses a Hamiltonian path. A hamiltonian path through a graph is a path whose vertex list contains each vertex of the graph exactly once.A hamiltonian graph is a graph that possesses a Hamiltonian path. Traveling salesman problem : Traveling salesman problem : A salesman who wants to minimize the number of miles the he travels in visiting his custommers. A salesman who wants to minimize the number of miles the he travels in visiting his custommers.
20
Discrete Probability The calculation of discrete probability usually involves counting arguments The calculation of discrete probability usually involves counting arguments Permutation: Permutation: P r n, is called the number of permutations of n objects taken r at a time. P r n, is called the number of permutations of n objects taken r at a time. P r n = n(n-1)…(n-r+1) P r n = n(n-1)…(n-r+1) = n! / (n-r)! = n! / (n-r)! Combination: Combination: Define for an r-element subset of an n-element set A is a combination of A, taken r at a time. Define for an r-element subset of an n-element set A is a combination of A, taken r at a time. C n r = n! / r!(n-r)! C n r = n! / r!(n-r)! Example: Compute the number of distinct 5 card hands which can be dealt from a deck of 52 cards. Example: Compute the number of distinct 5 card hands which can be dealt from a deck of 52 cards.
21
Discrete Probability (cont.) Answer: Answer: C 5 52 = 52!/(5! 47!) = 2,598,960 C 5 52 = 52!/(5! 47!) = 2,598,960 The pigeonhole principle: The pigeonhole principle: If n pigeons are assigned to m pigeonholes, and m km, then at least one pigeonhole must contain more than k pogeons. If n pigeons are assigned to m pigeonholes, and m km, then at least one pigeonhole must contain more than k pogeons.
22
References Truss, J.K. Discrete Mathematics for Computer Scientist. Addison-Wesley Publishing Company, 1991. Truss, J.K. Discrete Mathematics for Computer Scientist. Addison-Wesley Publishing Company, 1991. Kolman, Bernard and Robert. Discrete Mathematical Structures for Computer Science. Drexel University. Kolman, Bernard and Robert. Discrete Mathematical Structures for Computer Science. Drexel University. Doerr, Alan and Kenneth. Applied Doerr, Alan and Kenneth. Applied Discrete Structures for Computer Science. Science Research Associates, Inc. 1985.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.