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 controlling loops and conditional statements are based on
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 came up with the Chomsky hierarchy of languages Though
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): (N3)
P and NP
NP Stands stand for Nondeterministic poly
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 Compute Values
State Q0 Q1 Q2 Q3 Q4 B 3,0,L, 3,1,L 4,0,L
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) er |S|= Bound (~P ! n) Q P (size) (~P Arithmetic Sum P
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 midterm and 2/3 on material after the midterm. Prove b
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. Rosen Bernard Waxman EB 2024 Email: Department Web Pa
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. Sort the following in order by , (smallest to largest
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 j) while (i < j) cfw_ m = (i+j)/2; if (x > a[m]) i = m
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: Exercises
*2 (a) Not a proposition, (b) Not a proposition
-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- compound proposition thats always true Contradiction al
-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 Normal Form takes a compound proposition and sets it u
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.
(See PowerPoint slide Recursion.ppt .)
3. Set S contain
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. (Note that
is the exclusive or operator.)
b) _
p q is equi
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 of x is 1x, which
equals 1(2a). Since the additive inver
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 trees have many applications in computer science, for examp
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 < setw(5) < X else if T->data < X cout < setw(5) < T->data p
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, but only even integers. In order to make statements a
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. Another common sequence is of the form a, 2a, 3a, 4a, . , na
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 without ordering and without duplicates. The original forma
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 must solve the problem with a finite number of steps.
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 integers so important in computer science? Consider the memo
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 P n is a statement such as nn + 1 X i = =1 2 Proofs re
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 X3 X is a multiple of 3 for all values of X 0. In this
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. Another common sequence is of the form a, 2a, 3a, 4a, . , na