Counting the opposite
A password must contain only lower case letters or numbers. It must contain
at least one letter and at least one number. How many options are there?
Done last class: count all possible password, subtract the ones that have only
lette
For any two real numbers x and y:
n
(x + y) =
n
X
n
k=0
k
xk y nk .
What is the coefficient in front of x3 in the expansion of (x + 2)7 ?
What is the coefficient in front of x3 in the expansion of (2x + 1)7 ?
1
Pascals triangle
n
n
Pascals identity, and
Using the prime decomposition
If p is a prime so that pt divides a natural number n, then p must have exponent
greater than or equal to t in the prime decomposition of n.
Proof. Suppose that pt |n. Then there exists an integer k so that n = pt k. The
inte
Brain Teaser
There is a black box with 60 black balls and a white box with 60
white balls. You take 20 white balls and mix them into the black
box. Then you take 20 balls from the black box and mix them
into the white box. At the end, which is larger: the
The Wasson test
http:/puzzlewocky.com/brain-teasers/the-wason-selection-task/
1
Negating an implication
(p q) =
The negation of a conditional statement is NOT a conditional
statement.
A conditional statement can only be false if the condition is true.
2
Least Common Multiple
A common multiple of two integers a and b is a natural number m so that
both a and b are divisors of m.
Suppose k is a common multiple of a and b. Then every prime p in the
prime decomposition of a or b must in the prime decompositio
Are these valid proofs?
The sum of two rational numbers is rational.
Proof: take any two rational numbers r and s.
Since r is rational, r = ab for some integers a, b, b 6= 0.
Also s is rational, so s = ab for some integers a, b, b 6= 0.
Then r + s = ab +
Brain Teaser
There is a black box with 60 black balls and a white box with 60
white balls. You take 20 white balls and mix them into the black
box. Then you take 20 balls from the black box and mix them
into the white box. At the end, which is larger: the
Counting
In Dalhousies faculty club, a main course comes with soup or salad. There
are three different soups, and four different salads. How many choices for side
dish are there?
At the club, a lunch combo consists of a soup and a half sandwich. There are
Counterexample
We show that a logical argment is NOT valid by giving a specific instance
where all premises are true, but the conclusion is false. This is called a counterexample.
1:If room A contains a treasure, then the door sign is true, and if it cont
Remainder and quotient
Given two integers a and b, a can be written as the sum of a multiple of b,
plus an integer between 0 and b.
a Z, b Z, q Z, r Z, a = qb + r 0 r < b.
The integer r is called the remainder of a when divided by b. The integer q is
call
Theorem and Proof
Many theorems in math and computer science have the form of
a universal statement.
All integers greater than 1 have a prime divisor.
Every prime is odd unless the prime is 2.
The sum of two odd numbers is even.
1
Theorem and Proof
Consid
CSCI/MATH 2112 Discrete Structures I
Assignment 3.
Due on Tuesday, October 3, 11.30pm
In each of the proof questions, give a careful, detailed logical argument. Make
the steps in your logical argument as small as possible. For a good description of how
to
The fortune and the goat
A contestant in a game show has made it to the last round. She is asked to
choose between doors to two rooms, which each contain either a treasure or
a goat. The rooms have these statements written on them:
A. In this room there i
CSCI/MATH 2112 Discrete Structures I
Assignment 1.
Due on Tuesday, September 26, 5pm
1. [3, -1 for each incorrect answer.] Consider the statement: Concrete does not
grow if you do not water it. Answer the following quesions in and English
sentence, no sym
CSCI/MATH 2112 Discrete Structures I
Assignment 1.
Due on Tuesday, September 19, 11.30pm
1. [4pts, 1 each] Let h be the statement John is healthy, w = John is wealthy,
and s = John is wise. Write the following statements in symbolic form, using the
symbol
Discrete Mathematics I
(
(
(
(1
MATH/CSCI 2112 Assignment 5 Solutions Due: (
Wed
Mar Fri 3 Mar 2017
(1) (a) Write the converse of: If x and y are odd, then xy is even. Is the statement
that you wrote down T or F? Prove your answer.
ANSWER:
Converse: If x
CSCI 1101
Computer Science II
PRACTICE SET FOR TEST NO.1
SOLUTIONS
1 . For each of the following questions, select the most appropriate answer.
1. A class in java is like
a. a variable
b. an object
c. an instantiation of an object
d. a blueprint for creat
Lecture Summary: 16/01/17 MATH/CSCI 2112 Winter 2017
Covered in Class:
Recap Necessary & sufficient conditions: Examples
Ex 1. If f is differentiable at a then f is continuous at a. p q.
In this case, p : f is differentiable at a is a sufficient condition
Discrete Mathematics I MATH/CSCI 2112 Lecture 30/01n 01/02
Counting 3: Combinations continued and the Pigeon-hole principle
Combinations: Number of ways to choose a subset of r objects out of a set of n
objects without repetition (0 r n) is:
n
n!
n
=
Discrete Mathematics I MATH/CSCI 2112 Lecture 23-25/01
Counting Read Ch. 3 Sec 3.1 - 3.3 BoP
Count of subsets
How many subsets of does a set of n elements have?
S = cfw_s1 , s2 , . . . sn
n
0
1
2
Subsets
# subsets
cfw_
1 = 20
cfw_, cfw_s1
2 = 21
cfw_,
THE IMPLICATIONS OF IMPLICATIONS
MATH/CSCI2112
03 Lec 13/01
To review why an implication (p q) is true when both
the antecedent/premise (p) and the consequent/conclusion (q) are false:
Consider: If this card is a Heart then it is a Queen. Under what circu
Lecture Summary: 20/01/17 MATH/CSCI 2112 Winter 2017
Quantifiers
A proposition that has variables into which we can substitute values is called
a predicate. The truth value of the predicate depends on the values substituted
Ex. Q(n) : n2 + n + 41 is prim
Discrete Mathematics I MATH/CSCI 2112 Lecture 30/01n 01/02
Counting 3: Combinations continued and the Pigeon-hole principle
Combinations: Number of ways to choose a subset of r objects out of a set of n
objects without repetition (0 r n) is:
n
n!
n
=
MATH/CSCI 2112 Test 1 Review problems.
Here are some problems that cover the range of material covered.
The list below assumes that you have worked on the in class problems AND looked at assignment solutions.
This list is meant as a guide only.
` cfw_ in
Discrete Mathematics I
MATH/CSCI 2112 Assignment 8 Due 8 April 2016
(1) ('3) Obtain and prove the rule for divisibility by 3 (ii) Obtain and prove the
rule for divisibility by 9
ANSWER:
Let n I (dkdk_1 ' ' ' Gilda) Z (ilk X 10k + dk_1 X 10k'1 + dk_2 X 10"
(1)
(2)
Discrete Mathematics I MATH/CSCI 2112 Winter 2016
Assignment 7 Due Wed 30 March 2016
In the lecture notes (29/02 - 2 f 03 Proofs: Number Theory 2), we obtained a rule for
an integer to be divisible by 11. However, the rule was obtained by the obse
Discrete Mathematics I
MATH/CSCI 2112 Assignment 5 Due: Mon 7 March 2016 (hard deadline)
(1) (a)
(b)
(2) (a)
(b)
In the previous assignment, you showed: (12 even => (1 even.
Use the result to show (13 even => (1 even.
ANSWER:
cfw_13 even .e.cfw_a2 -a) eve
Discrete Mathematics I MATH/CSCI 2112 Winter 2016
Assignment 6 Due Fri 18 March 2016
(1) a, b, (1,? E Z 3 a = bq+ 'r'. Prove or disprove the following: cfw_1' gcd(a, q) = gcd(q, 1')
(ii) scdmm) | 0 (iii) sedan 5) = gcd(a,q) (iv) gcdm, 'r) | q
ANSWER: (2')
Class notes, Jan 16 and 18. Chapter 4 in Principles and Techniques in Combinatorics.
Inclusion/exclusion
Problem: 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 contain th