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.
Converse: q p
Inverse: p q
Recall that p q is equivalent to the boolean expression p q, so q p is equi
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 predicate that the person p appeared on game show g and D(p)
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 ?
Claim: n3 < 3n for n 4
Base Case: As shown in t
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 your algorithm correct.
Pow (a, n)
if n = 0
For all integers k, n, 0 < k < n,
This, and the fact that n = n
0 = 1, allows us to construct
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.
Addition and Multiplication Principle
1. A doughnut shop has five types of doughnuts, four types of muffins
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 are independent.
Random variable: let X be the number of
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 probability 53 , independent of what happened in previous
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 beginning and end point do not count)?
What is the expe
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:
an xn = 3
Let a(x) =
n=1 an x .
an1 xn + 10
an2 xn + 3
2n xn .
Combinations, Permutations, WallsBalls, Count the opposite, Multinomial
1. Four dice are tossed at the same time. How many different outcomes are
2. How many grid paths are ther
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?
Principle of inclusion/exclusion
1. How many permutations of all lette
Class notes, Jan 11+13. Chapter 4 in Principles and Techniques in Combinatorics.
1. How many permutations of all letters of the alphabet contain the word CAT?
How many contain the word CAT or the word DOG? How many co
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
seems as though the coecient of xn in the power series is
Class notes, Jan 1823.
Section 1.6 in Principles and Techniques in Combinatorics, Wiki page on
ufer sequences, Wiki page on Tree traversals.
Relations and functions
The Carthesian product of sets A and B is the set
A B = cfw_(a, b) : a
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 set
of natural numbers N to A. For example, let E be the
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
Consider the following counting questions:
Review from last class
Walls and Balls
Recognizing the problem
A judge at a flower show knows nothing about orchids. If he picks randomly, and there are
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 if the coupon gives
you a free doughnut and a muffin. Ho
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.
Traverse the tree in pre-order. No
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, b) R.
Function notation: f : A B. Instead of (a, b) we
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 space is the set of all outcomes: cfw_1, 2, 3, 4, 5, 6
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
If n > 1, then let T1 , . . . , T` be the subtrees of T .
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 + x4 )2 ? What
counting problem does this solve?
MATH 2113 - Assignment 3
Due: Jan 28
6.6.4 - Using the denition, we nd that
n(n 1)(n 2)(n 3)!
n 3n2 + 2n
6.6.13 - Using the denition we can calculate
(r + 1)!(n r 1)!
(r + 1)r!
(n r)(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
numbers without a common factor it must be of the form n = a b where
a contains some subset of the primes which divide n and
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
b) Since even and odd numbers alternate, half of o
MATH 2113 - Assignment 6
Due: Mar 4
1. Let S be the set of states for a nite automaton and let
set of characters that it acts upon. We dene the next state function
a) Under what conditions is N onto?
N will be onto, if in the transition di
MKTG 3376 (Consumer Behavior)
Review Questions for the Final Exam
(Chapters 7-10 & Data Analysis)
Chapter 7: Attitudes (Skip the section Using Attitudes to Predict Behavior, pp. 199-204.)
1) Julia's favorite magazines are Vogue and Harper's Bazaar; she lo