MAT251
Loop invariants
A loop in an algorithm or program is a sequence of one or more steps that is performed
repeatedly as long as a specified condition is met. If g is the guard condition that controls entry into
the loop and S is the sequence of steps,

Brooklyn College
Department of Computer and Information Science
CISC 2210 [11] Introduction to Discrete Structures
3 hours; 3 credits
Elementary set theory, functions, relations, and Boolean algebra. Switching circuits, gating
networks. Definition and ana

Notes on 1.6 Sequences
Note preliminary comm ents about subscripts, polynomials, summ ations, and general products, pp34-35.
Every function with domain or P is a sequence. Indeed, if the domain is cfw_m, m+1, m+2, .
for some integer m, the function is a s

Notes on Chapter 2.1 Informal Introduction to Elementary Logic
Key concepts:
Validity of arguments;
creating acceptable proofs;
knowing formal logic rules;
logic as a tool.
A proposition is a sentence that is either true or false but not both.
EXAMPLE 1 g

251 Notes 2.2 Propositional Calculus
Develop set of formal rules for analysis of propositions
and have a mechanical way to determine truth value of complicated propositions.
p
0
1
p
1
0
p
0
0
1
1
q
0
1
0
1
pvq
0
0
0
1
pwq
0
1
1
1
p6q
1
1
0
1
p:q
1
0
0
1
E

251 Notes 2.3 Getting started with proofs
. proofs are the only way to justify statements that are not obvious. [p66]
Begin to prove or disprove by looking at examples
Do Exercise 1 on page 67. Then Exercise 2 on page 67.
To begin a proof, translate the p

251 Notes 2.4 Methods of Proof
Recall proof by cases and proof by contradiction
Direct proof: H1 v H2 v . v Hn Y C
Most natural, and quite common form.
Two types of indirect proof use the negation of the Conclusion
Proof of the contrapositive: C Y (H1 v H

251 Notes on 2.6 Analysis of Arguments (proofs and fallacies)
An argument is said to be valid if it is has a formal proof.
A sequence of statements that does not correspond to a formal proof is called a fallacy.
Recall the rules of valid inference [used a

251 Notes 2.5 Logic in Proofs (Valid arguments)
EXAMPLE 1 L 6 F / L / F is clearly seen to be valid [Note / means new line; / means line]
Modus ponens logical implication pv(p6q)Yq means the proposition (pv(p6q)6q is a tautology.
For compound propositions

251 Notes on 1.7 Properties of Functions
Key ideas:
matching of elements of two sets
and decomposition of domains
Class size limit is 25; each students registers in next available (numbered) slot. F:S6N
Each registrant has only one slot and each slot is f

251 Notes Section 1.5 Functions
A function f assigns to each element x in some set S a unique element in a set T.
f is defined on S with values in T. The set S is called the domain of f, Dom(f)
f(x) is called the image of x under f; the set of all images

251 Notes Section 1.4
A = cfw_ 2, 3, 5, 8, 11, 13 B = cfw_2, 3, 5, 7, 11
Union A c B = cfw_ x : x0A or x0B (or x is in both) A c B = cfw_2, 3, 5, 7, 8, 11, 13
Intersection A 1 B = cfw_x : x0A and x0B
A 1 B = cfw_2, 3, 5, 11
Disjoint sets have empty (pair

[1.2a] Notes on 1.2 Continued
Theorem 2 Every positive integer can be written as a product of primes in only one way, except for the
order of the factors. [Proof later: pp167 and 177]
Example 4 Factors of 120: 1,3,5,15,2,6,10,30, 4,12,20,60,8,24,40,120
or

MAT251 Notes on 1.2 Factors and Multiples
Natural numbers are the set of nonnegative integers cfw_0, 1, 2, 3, .
For integers m and n, n is a multiple of m if n = km, for some integer k.
n is divisible by m, m divides n, m*n, m is a divisor of n, m is a fa

MAT251 Notes on 1.1 Some warmup questions
Important principles:
Precision,
Abstraction,
Standard terms and notation.
Logical thinking.
Abstraction: specific cases general problems
1) focus on core issues
2) solution fits a class of problems
3) greater mas

Probability
! Our setting for probability is a sample space S and a
probability P: for events E f S, P(E) is a number [0,1] and
represents the probability of event E.
! Conditional Probability:
Given a sample space S and events E and S. With P(S) > 0,
the

Relations
! Given sets S and T, a binary relation from S to T is any subset
R of S T (i.e., R f S T).
! Example;
A university would be interested in the relation R consisting
of all ordered pairs whose first entries are students and
whose second entries a

251 Notes 3.1 Relations
A (binary) relation from S to T is a subset R of ST, any subset.
If S = T, then any subset of SS is called a relation on S.
It generalizes the function mapping concept in that it need not be a set of each to one pairings.
We say s

3.2 Notes on digraphs
A directed graph G [called directed multigraph by some] consists of a nonempty set
V(G) of vertices of G and the set E(G) of edges of G, together with a function ( from E(G) to
V(G) V(G) that tells where the edges go.
If e is an edge

Equivalence Relations and Partitions of a Domain
A relation on a set S that is Reflexive, Symmetric, and Transitive is an equivalence relation.
The subsets of S that consist of elements that are related are called equivalence classes.
Example Which of the

MAT251 Review of Unit one
Brief solutions
1. Outline briefly the process used to derive the formula for computing the number of multiples
of k between integers m and n, where m # n and k is a positive integer.
Various problem-solving methods were used, in

MAT251 Review of Unit one
1. Outline briefly the process used to derive the formula for computing the number of multiples
of k between integers m and n, where m # n and k is a positive integer.
2. Find all of the factors of 360.
3. List all the elements i

6.3 Trees
A path in an undirected graph G = (V, E) is a sequence of edges that connect adjacent vertices.
An undirected graph G = (V, E) is connected if there is a path between any pair of vertices.
In a simple graph this path can be denoted by the sequen

6.1 Notes on Graphs
A graph G with undirected edges [called a multigraph by some] consists of a nonempty
set V(G) of vertices of G and the set E(G) of edges of G, together with a function ( from E(G) to
the set cfw_u, v: u, v 0 V(G) [all subsets of V(G) w

Pigeon Hole Principle
Remark: Any function (mapping) from a finite set into a smaller finite set cannot be one-to-one.
Example 1
10 people want to go to the movies, and there are only 7 cars. The mapping for this with people on the
left, and cars on the r

An ordered partition of a set is a sequence of pairwise disjoint nonempty subsets for which the
union of these subsets is the set itself.
Example Members of a group of 15 people are assigned to three committees of size 3, 4, 5 with no
person serving on mo

Notes on Chapter 5.2 Elementary Probability
A sample space is the set of
all possible outcomes (distinguishable results) from
an experiment (repeatable action).
If S is the sample space, containing outcomes T i, then subsets of S are called events.
A prob

Proof by mathematical induction using a strong hypothesis
Occasionally a proof by mathematical induction is made easier by using a strong hypothesis:
To show P(n) [a statement form that depends on variable n], do:
(1) BASIS: Establish [P(m)vP(m+1)v.vP(m+r