MATH 224 Discrete Mathematics
Why Study Discrete Math
Determination of the efficiency of algorithms, e.g., insertion sort versus selection sort. Can you provide an example? Boolean expressions for con
MATH 224 Discrete Mathematics
Syntax and formal languages
Noam Chomsky developed the idea of grammars for formal languages in the mid 1950s In an attempt to formalize grammars for natural languages he
P and NP
P Stands for solvable in polynomial time, e.g., Heapsort for N elements: (NlogN) = O(N2) All pairs shortest distance (Floyd-Warshall) for an N node graph: (N3) Matrix Multiplication (N x N):
Turing Machine Read/Write Move Left/Right
B 0 0 1 0 0 0 B
State Qi
Read/Write Head
8/27/09 11
State Diagram for Modulus 3
Start Q0 0 0 0 1 1 1 Q1
B
B B
Q2
Q3 8/27/09
Q4 22
Turing Machine Program To Co
Growth of Functions ~P all reals in Reverse Order ogn) Hypothetical syllogism bers (O) s Theorem (DeM) eMorgan' O n Order garithmic complexitydoesn' t matter) (HS) nts / Combinations (order PQ 3 v ~Q)
Review Problems MATH 224 Final Fall 2008
1.
Be sure to look over all old quizzes, assignments, midterm exam and the midterm review. Approximately 1/3 of the exam will be on material covered before the
Truth Tables
p -> q q -> p q -> p -> for all
(original implication) (converse) p (contrapositive equivalent to original implication) q (inverse) and there exists
MATH 224 (001)
Room: Time: Texts: Instructor:
Discrete Mathematics
Fall 2008
Bluff Residence Hall CLS Monday & Wednesday 1:30 2:45 p.m. Discrete Mathematics and Its Applications 6th Edition, Kenneth H
Midterm REVIEW MATH 224
1. Review the relevant sections from Chapters 1 4 in our text, quizzes, and written assignments. 2. Construct a truth table for p q q. 3. Construct a truth table for p (q r). 4
MATH 224 Discrete Mathematics
Recursive C+ Functions Iterative version Recursive version
Normally i is initialized to 0 and j to n1 for an array of size n.
int binary_search(in x, int a[ ], int i, int
Assignment 1
100 Points Due August 31, 2011
Solutions
(4 points each only problems marked * are graded others are check to see
if you made an attempt to solve them.)
From the test book
Pages 16 20: Ex
Assignment 2
(4 points each)
100 Points Due September 12, 2011
Solutions
*These are to be graded
Pages 47 50:
x[C(x) ^ D(x) ^ F(x)], (b)
10 (a)
(d)
x [C(x) ^ D(x) ^ F(x)] or
x [C(x) v D(x) v F(x)], (
-Rules of Inference: Modus Ponens:
- Proposition
[ ( p q ) ( q r ) ] (q r )
[ p ( p q)] q Hypothetical Syllogism
p q logically equivalent with Contrapositive q p
Converse
q p
Inverse
p q
-Tautology-
-Rules of Inference: Modus Ponens:
p q logically equivalent with Contrapositive q p
- Proposition
[ ( p q ) ( q r ) ] (q r )
[ p ( p q)] q Hypothetical Syllogism
Converse
q p
Inverse
p q
-Disjunctive
Review Problems MATH 224 Final
1. Review all old quizzes, assignments, and the midterm exam.
2. Prove by induction starting at N = 1, that B(N,1) = N based on the recursive definition
given in class.
Math 224
QUIZ I
August 29, 2011
1. For each of the following indicate if the statement is TRUE (T) or FALSE (F). [5 points]
(Note that TRUE here means true in all cases.)
a) _
p
p is always false. (No
Assignment 3
100 Points Due September 26, 2011
Graded exercises marked in red. Four points for each problem.
Pages 85:
4. If x is an even integer then x = 2a for some integer a. The additive inverse o
MATH 224 Discrete Mathematics
Deterministic Finite Automata Finite State Machines Set of States Start State Accepting States Alphabet Transitions
8/27/09
Q q0 Q qf 8 Q
q1
q2 q0
q3
qf1
qf2
8 e.g, cfw_0
MATH 224 Discrete Mathematics
Rooted Trees
A rooted tree is a tree that has a distinguished node called the root. Just as with all trees a rooted tree is acyclic (no cycles) and connected. Rooted tree
Tree Print Function
void print_nodes(int X) print_helper(root, X); cout < endl End print_nodes
Tree Print Function Continued
void print_helper(node* T, int X) if T = = NULL OR T->data = = X cout < set
MATH 224 Discrete Mathematics
Predicate Calculus
Some of the statements that are important in mathematics and computer science are not propositions. For example, X % 2 = 0 is not true for all integers
MATH 224 Discrete Mathematics
Sequences and Sums
A sequence of the form ar0, ar1, ar2, ar3, ar4, . , arn, is called a geometric sequence and occurs quite often in computer science applications. Anothe
MATH 224 Discrete Mathematics
Basic Structures - Sets
Sets provide a basis for many of the data structures used in computer science. As you already know sets are collections of any type of object with
MATH 224 Discrete Mathematics
Algorithms and Complexity
An algorithm is a precise recipe or set of instruction for solving a problem. In addition, to be considered an algorithm the set of instructions
MATH 224 Discrete Mathematics
Integers and Computers
Integers and number theory are important building blocks for computer science. (Number theory deals with the properties of integers.) Why are integ
MATHEMATICAL INDUCTION
Mathematical induction is a property of the integers that can be used to prove statements such as 8n n1; n 2 Z P n, where 8 means for all x, n 2 Z means that n is an integer and
MATH 224 Discrete Mathematics
Induction
Induction allows us to prove properties that hold over the integers are some infinite subset of the integers. So for example it provides for a way to prove that
MATH 224 Discrete Mathematics
Sequences and Sums A sequence of the form ar0, ar1, ar2, ar3, ar4, . , arn, is called a
geometric sequence and occurs quite often in computer science applications. Anothe