MATH/CSCI 2112 Assignment 1 Solution
26 Jan 2015
(1) (a) Given the implication p q, show that its converse and inverse are logically equivalent.
ANSWER:
Converse: q p
Inverse: p q
Recall that p q is e
MATH/CSCI 2112 DISCRETE MATHEMATICS I
ASSIGNMENT 2 SOLUTION JAN 31 2015
(1) Let G represents the set of all T.V. game shows. Let P be the set of people in your neighbourhood. Let C(p, g) be the predic
DISCRETE MATHEMATICS I
MATH/CSCI 2112 ASSIGNMENT 6 SOLUTIONS
DUE 23 MAR 2015
(1) Prove by induction on n > n0 that n3 < 3n . What is the value n0 ?
ANSWER:
n
0
1
2
3
4
5
n3
0
1
8
27
64
125
3n
1
3
9
27
Discrete Mathematics I MATH/CSCI 2112 Winter 2015
Bonus Assignment 7 Solution Due Fri 10 April 2015
(1) (a) Write an (ecient) recursive algorithm Pow (a,n) than computes
an , a R, n Z+ cfw_0. Prove yo
1
1
1
1
1
1
1
1
7
2
3
4
5
6
1
3
6
10
15
21
1
4
10
20
35
1
1
5
15
35
1
6
21
1
7
1
Pascals formula
For all integers k, n, 0 < k < n,
n
k
=
n 1
k1
+
n 1
k
.
n
This, and the fact that n = n
0 = 1, all
Permutations
An inversion in a permutation of [n] is a pair i, j, 1 i < j n, where j occurs
before i in the permutation.
A permutation is odd if it has an odd number of inversions, and even otherwise.
Class notes, Jan 410.
Read more: Chapter on counting in Book of Proof. Chapter 1 in Principles and
Techniques in Combinatorics.
Counting techniques
Addition and Multiplication Principle
1. A doughnut
First success
Suppose you repeat an experiment until the first time it succeeds, and the
chance of success is p. What is the expected number of trials you perform?
Assume that outcomes of the trials a
Probability and tree diagrams
Two hockey teams, A and B, play a best 2 out of 3 series (thus, the player
that first wins two games wins the series.) Suppose team A is stronger, and
wins a game with pr
Grid paths
Consider grid paths from (0, 0) to (6, 6). The main diagonal is the diagonal
from (0, 0) to (6, 6).
What is the expected number of times that such a grid path meets the main
diagonal? (The
Generating functions to derive direct formula
a0 = 0, a1 = 6, an = 3an1 + 10an2 + 3 2n , for all n 2.
Multiply recurrence by xn , and sum over all valid values of n:
X
an xn = 3
n=2
Let a(x) =
P
n
n=1
Warmup
Combinations, Permutations, WallsBalls, Count the opposite, Multinomial
(MISSISSIPPI), Inclusion/exclusion.
1. Four dice are tossed at the same time. How many different outcomes are
there?
A: 1
Permutations
How many permutations of all letters of the alphabet contain the word CAT?
How many contain the word CAT or the word BAG? How many contain the
word DOG and the word CAT?
1
Principle of in
Class notes, Jan 11+13. Chapter 4 in Principles and Techniques in Combinatorics.
Inclusion/exclusion
Warm-up problems.
1. How many permutations of all letters of the alphabet contain the word CAT?
How
Generating Functions
If you take f (x) = 1/(1 x x2 ) and expand it as a power series by long division, say,
then you get f (x) = 1/(1 x x2 ) = 1 + x + 2x2 + 3x3 + 5x4 + 8x5 + 13x6 + . It certainly
see
Class notes, Jan 1823.
Section 1.6 in Principles and Techniques in Combinatorics, Wiki page on
Pr
ufer sequences, Wiki page on Tree traversals.
Bijective proofs
Relations and functions
The Carthesian
Class notes, January 25 and 27
Wiki page on Cantors diagonal argument
Cardinality of infinite sets
Countably infinite sets
An infinite set A is called countable if there exists a bijection from the se
Class notes, Feb 29
Chapter 6 of Principles and Techniques in Combinatorics , Wiki page on
Catalan numbers. Web page on Josephus problem (see links on OWL)
Recurrence relations modelling
Fibonacci num
Review from last class
(List) Ordered
(Set) Unordered
Repetition
Multiplication Pr.
Walls and Balls
No repetition
Permutation
Combination
1
Recognizing the problem
A judge at a flower show knows noth
Addition and Multiplication Principle
A doughnut shop has five types of doughnuts, four types of
muffins. You receive a coupon which gives you a free doughnut or muffin. How many possibilities? What i
Counting Unlabelled, Rooted, Ordered Trees
An Unlabelled, Rooted, Ordered Tree on n vertices (nodes) can be represented
by a binary word of length 2(n1) on the alphabet of open and closed brackets.
Br
Functions, formally.
Carthesian product.
A B = cfw_(a, b) : a A, b B.
A relation from A to B is a subset of A B.
A function is a relation R so that for every a A, there is exactly one b B
so that (a,
Probability Space
A probability space consists of three parts:
Example: Throwing a fair die.
Sample Space. This is the set of all possible outcomes. Here we assume this
set to be finite.
The sample sp
Recursive Definition of Bracket Notation
Let T be a rooted, unlabelled, ordered tree with n nodes.
If n = 1, so T consists only of the root, then bracket notation bn(T ) is the
empty string.
If n > 1,
Polynomials
1. What is the coefficient of x2 in the polynomial (x + 1)5 ?
2. What is the coefficient of x4 in the polynomial (x + 2)6 ?
3. What is the coefficient of x5 in the polynomial (x + x2 + x3
MATH 2113 - Assignment 3
Due: Jan 28
6.6.4 - Using the denition, we nd that
n!
3!(n 3)!
n(n 1)(n 2)(n 3)!
=
3!(n 3)!
3
n 3n2 + 2n
=
6
n
3
=
6.6.13 - Using the denition we can calculate
n
r+1
n!
(r + 1
MATH 2113 - Assignment 2 Solutions
Due: Jan 21
6.2.27 - Since we want to write n = pk2 pk2 pkm as a product of two positive
2 2
m
numbers without a common factor it must be of the form n = a b where
a
MATH 2113 - Assignment 5 Solutions
Due: Feb 16
6.2.20 - a) Using theorem 6.1.1, the number of elements in a list from n to
m is m n + 1. Therefore, from 1000 to 9999 there are 9999-1000+1 = 9000
eleme
MATH 2113 - Assignment 6
Due: Mar 4
1. Let S be the set of states for a nite automaton and let
be the
set of characters that it acts upon. We dene the next state function
N :S
S.
a) Under what condit