Lecture 2
2.4 Mathematical Induction
Principle of Mathematical Induction
Assume that S(1) is true. (basis step)
Assuming that S (n) is true for n 1, prove
that S(n+1) is true. (induction step)
Example:
S (n) = Sn = 1 + 2+ . +n = n(n+1)/2 for all n
1.
As
Jesse Jenkins
CIS 275 Project 2
Due 10/25/15
I used Code:Blocks to code this program.
Here is my source code:
#include <iostream>
using namespace std;
void convertDecToBin(int);
void convertDecToHex(int);
int main()
cfw_
int x;
cout < "Hello and welcome t
CIS 275 Discrete Math I
Summer 2016
Correction of Assignment 02
Evaluation:
As described in the syllabus, the assignments are 30% of the overall grade.
Submission:
Submit your document on Monday 05/16/16. No late submission will be accepted.
Exercise 1:
U
CIS 275 Discrete Math I
Summer 2016
Correction of the Assignment 03
Evaluation:
As described in the syllabus, the assignments are 30% of the overall grade.
Submission:
Submit your document on Monday 05/23/16. No late submission will be accepted.
Exercise
CIS 275 Discrete Math I
Summer 2016
Correction of Assignment 01
Evaluation:
As described in the syllabus, the assignments are 30% of the overall grade.
Submission:
Submit your document at the beginning of the lecture on Monday 05/09/16. No late
submissi
CIS 275 Discrete Math I
Summer 2016
Correction of Assignment 05
Evaluation:
As described in the syllabus, the assignments are 30% of the overall grade.
Submission:
Submit your document on Monday 06/13/16. No late submission will be accepted.
Exercise 1:
S
CIS 275 Discrete Math I
Summer 2016
Correction of Assignment 03
Evaluation:
As described in the syllabus, the assignments are 30% of the overall grade.
Submission:
Submit your document on Monday 06/26/13. No late submission will be accepted.
Exercise 1: U
Formula
The Sets
Mathematical induction
The Principle of Mathematical Induction consists of two steps:
v Basic step : Prove that S(1) is true.
v Inductive step : Assuming that S (n) is true for n 1, prove that S(n+1) is true
Then, S(n) is true for every p
CIS 275 Discrete Math I
Summer 2016
Correction of Exercises
Chapter 8: Recurrence relations
Exercise 1:
Let consider the recurrence relation
= 2 !
! = 1
And the initial condition
Solve the recurrence relation Sn by iteration.
By iteration :
Sn = 2 Sn-1 =
CIS 275 Discrete Math I
Summer 2016
Chapter 2: Mathematical Induction
Exercises
Exercise 1: Using the induction, verify that each equation is true for every positive integer
n 1.
a) 1 + 3 + 5 + + (2n 1) = n2
b) 12+ 22+ 32+ + n2=
+ 1 (2 + 1)
6
Exercise 2:
Lecture 21
9.5. Binary Trees
Binary Trees
Def: A binary tree is a rooted tree which has
either a left child, a right child, a left child and a
right child, or no children.
Ex:
A
A
B
B
The above trees are NOT same.
Full binary trees
DEF: A full binary tree
Lecture 22
9.6. Tree Traversals
Arithmetic Expressions
There are 3 types of expressions:
1. In-order expression
op1 op op2
ex. a + b
2. Pre-order expression
op op1 op2
+ab
3. Post-order expression
op1 op2 op
ab+
Converting an in-order to a post-order
expr
Chapter 4 : Algorithms
Introduction
Algorithms
Definition: An algorithm is a step-by-step method of solving some problem.
Algorithm typically refers to a solution that can be executed by a computer.
Algorithms typically have the following characteristic
CIS 275 Discrete Math I
Summer 2016
Chapter 3: Functions, Sequences and Relations
Exercises
I.
Functions:
Exercise 1: Find the element of each set, draw a graph and determine if the function is
one-to-one, onto or both. If it is one-to-one and onto, give
CIS 275 Discrete Math I
Summer 2016
Preparation for the Mid-Term Exam
Name:
Time: Complete and submit to the instructor
Evaluation:
As described in the syllabus, the Mid-term Exam is 35% of the overall grade.
Exercise 1: Let the universe be the set U =cfw
Chapter 8 : Graph Theory
Introduction
Graph Theory
Definition: A graph G consists of two sets V and
E, where:
V is a nonempty set of vertices
E is a set of edges.
We denote a graph G
G = (V, E)
3
Graph Theory
Example: undirected Graph G1
G1
1
G1 = (V1, E
CIS 275 Discrete Math I
Summer 2016
Correction of Exercises
Chapter 1 : Sets
Exercise 1: Let the universe be the set U =cfw_1, 2, 3, 10.
Let A = cfw_1, 5, 8, 9, B = cfw_1, 2, 3, 4, 5, 6 and C = cfw_3, 5, 6, 8.
List the elements of each set
v A B = A (U B
CIS 275 Discrete Structures I
Fall 2014
Instructor: Habib M. Ammari
Ph.D. (CSE), Ph.D. (CS)
Lecture 2
September 8, 2014
Dearborn, Michigan
Review
Comparison and Set Operators
Proper subset
A subset of B and A B: A B
A = cfw_129, 132, B = cfw_111, 129, 132
CIS 275 Discrete Structures I
Fall 2014
Instructor: Habib M. Ammari
Team Work 1
Date: Sep. 15, 2014
Problem (Analysis): In a hallway, there are three doors which allow access to three different
rooms. These three doors are numbered 1, 2, and 3. Furthermor
CIS 275 Discrete Structures I
Fall 2012
Lecture:
Monday and Wednesday 6:00pm-7:45pm, 1030 CASL Building
Instructor:
Habib M. Ammari, Ph.D. (CSE), Ph.D. (CS)
Office: 129 CIS Building
Email: hammari at umd dot umich dot edu
Phone: (313) 393-5239
Home page:
Problem 15: What are the terms a0, a1, a2, and a3 of the sequence cfw_an, where an equals.
1. 2n + 1?
2. (-2)n?
3. 2n + (-2)n?
4. 7?
5. (n + 1)n+1?
6. n / 2 ?
7. n / 2 + n / 2 ?
Problem 16: List the first 10 terms of each of the following sequences.
1. Th
CIS 275 Discrete Structures I
Fall 2014
Instructor: Habib M. Ammari
Practice 1
Date: Sep. 3, 2014
Problem 1: Let A be the set of students who live within one mile of school and let B be the set of
students who walk to classes.
Describe the students in eac
Problem 11: Find the inverse function of f (x) = x3 + 1.
Problem 12: How many bytes (which are blocks of 8 bits) are required to encode n bits of data
where n equals
1. 4?
2. 7?
3. 10?
4. 17?
5. 500?
6. 1001?
7. 3000?
8. 28,800?
Problem 13: A partial func
Problem 6: Determine whether each of the following functions is a bijection from R to R.
1.
2.
3.
4.
f (x) = -3x + 4
f (x) = -3x2 + 7
f (x) = (x + 1) / (x + 2)
f (x) = x5 + 1
Problem 7: Give an explicit formula for a function from the set of integers to t
CIS 275 Discrete Structures I
Fall 2014
Instructor: Habib M. Ammari
Homework 2
Due Date: Sep. 15, 2014
Problem 1: Let f be a relation defined from R to R. Check whether f is a function in each of the
following cases.
1. f (x) = 1 / x
2. f (x) =
3. f (x)
Problem 12: Assume A, B, and C are sets. Draw the Venn diagram for each of the following
combinations.
1. (A B) C
2. B
3. (A B) (A C) (B C)
Problem 13: Assume A, B, and C are sets. Draw the Venn diagram for each of the following
combinations.
1. A (B C)
2
Problem 18: Let A and B be two sets.
1.
2.
3.
4.
What is the bit string corresponding to the difference of A and B? Explain.
Assume A = cfw_1, 3, 5, 7, 9 and B = cfw_1, 3, 6, 7, 8, 9. Find the bit string of A B.
What is the bit string corresponding to the