math 401 test 1 Flashcards
an m-by-n board has a perfect cover by b-ominos if and only if
b is a factor of m or n
the magic number for magic squares
s = [n(n^2 + 1)] / 2
each row, column, and the two diagonals add to this
how to find the magic square when n is odd
- place a 1 in the middle square of the top row
- place successive integers in natural order along upward-right sloping diagonal line
- when top is reached, but in bottom row as if it came immediately above the top row
- if box is already filled, put immediately below the last square filled
any map can be colored by using ? colors such that two countries sharing a common boundary receive different colors
4
latin square of order n
n-by-n array of numbers 1 to n such that each 1 to n occurs once in each row and column
orthogonal latin squares
all possible n^2 pairs (i, j) with i = 1, 2, … , n and j = 1, 2, … , n; occur when two latin squares are juxtaposed
euler says orthogonal works if n is ?; n = ?
odd; n = 4s
the game of nim: when will player 1 win? player 2?
player 1 will win an unbalanced game
player 2 will win a balanced game
if the game of nim is unbalanced, what should player 2’s first move be?
balance the game
how to tell if a game of nim is balanced
write out the numbers’ binary representations and add down the columns. if all numbers are equal then it is balanced
addition principle
the number of objects in a set S can be determined by finding the number of objects in each of the parts and adding the numbers
multiplication principle
let S be a set of ordered pairs (a, b) of objects, where the first object comes from a set of size p, and for each choice of a there are q choices for object b. Then |S| = pq
subtraction principle
|A| = |U| - |A complement|
division principle
let S be a finite set that is partitioned into k parts in such a way that each part contains m objects. then k = |S| / m
inclusion exclusion
good - bad
permutations of sets
an ordered arrangement of r elements without repetition; P(n, r) = n! / (n-r)!
circular r-permutation of a set of elements
an ordered arrangement of r elements around a circle of r positions without repetition; P(n, r) / r = n! / r(n-r)!
combinations of sets
an unordered selection of r elements without repetition; (n choose r) = P(n, r) / r! = n! / (n-r)!r!
Pascal’s Formula
n choose k = (n-1 choose k) + (n-1 choose k-1)
one subset containing “special” and one excluding it
For any n >= 0, n choose 0 + n choose 1 + … + n choose n =
2^n
permutations of multisets
an ordered arrangement of r elements of S with repetition
Let S be a multiset with objects of k different types, where each object has an infinite repetition number. Then the number of permutations of S is
k^r
Let S be a multiset of objects of k different types with finite repetition numbers n1, n2, …, nk respectively. Let the size of S be n = n1+n2+…+nk. Then the number of permutations of S equals
n! / n1!n2!…nk!
Let n, n1, n2, …, nk be positive integers with n = n1+n2+…+nk. Then the number of ways to partition a set of n objects into k labeled boxes such that box 1 contains n1 objects, box 2 contains n2, etc. equals ?
If the boxes are not labeled and n1=n2=…=nk, then the number of partitions equals ?
n! / n1!n2!…nk!
n! / k!n1!n2!…nk!
There are n rooks of k colors with n1 rooks of the first color, n2 rooks of the second color, …, nk rooks of the kth color. The number of sways to arrange these rooks on an n-by-n board such that no rooks can attack each other is
(n!)^2 / n1!n2!…nk!
combinations of multisets
an unordered selection of r elements of S with repetition
Let S be a multiset with objects of k types, each with an infinite repetition number. Then the number of r-combinations of S equals
(r+k-1 choose r) which equals (n+k-1 choose k-1)
pigeonhole principle simple form
if n+1 objects are put into n boxes, then at least one box contains two or more objects
if n objects are put into n boxes and no box is empty, then
each box contains exactly one object
if n objects are put into n boxes and no box gets more than one object, then
each box contains exactly one object
pigeonhole principle strong form
Let q1, q2, …, qn be positive integers. If q1+q2+…+qn - n+1 objects are put into n boxes, then there exists an i with 1 <= i <= n such that the ith box contains at least qi objects
if n(r-1)+1 objects are put into n boxes, then
at least one box contains r or more objects
if the average of n nonnegative integers m1, m2, …, mn is greater than r-1, then
at least one of the integers is >= r
if the average of n nonnegative integers m1, m2, …, mn is less than r+1, then
at least one of the integers is < r+1
a theorem of Ramsey
if m>=2 and n>=2 are integers, there exists a positive integer p such that Kp => Km, Kn. The smallest number p such that Kp => Km, Kn is called the Ramsey number, denoted by r(m,n)
algorithm for generating all permutations of a set
begin with 1 2 … n with all left arrows
while there is a mobile integer do
1. find the largest mobile integer m
2. switch m with adjacent integer its arrow points to
3. switch direction of all integers greater than m
for a set {1, 2, …, n}, 1 can never be ? and n is ? except ?
1 can never be mobile
n is mobile except if n is in the first position and its arrow points left or n is in the last position and its arrow points right
Let i1, i2, …, in be a permutation of {1, 2, …, n}. The pair (ik, il) is called an inversion if k < l and ik > il. Let aj equal the number of integers which precede j in the permutation but are greater than j for i<=j<=n. The sequence of numbers a1, a2, …, an is called
the inversion sequence
Let b1, b2, …, bn be a sequence of integers satisfying 0<=b1<=n-1, 0<=b2<=n-2, …, 0<=bn-1<=1, bn=0. Then there exists a unique permutation of {1, 2, …, n} whose inversion sequence is
b1, b2, …, bn
Algorithm 1 for determining permutations from inversion sequences
Start from n - write down n
For n-1, if bn-1 = 0, write n-1 before n; if bn-1=1, write n-1 after n
…
For n-k, if bn-k = 0, write (n-k) before the current sequence; if bn-k = 1, write (n-k) between the first two elements of the current permutation; if bn-k = k, write (n-k) in the last position of the permutation
…
Put 1 after the b1’s position of the permutation created
Algorithm 2 for determining permutations from inversion sequences
Begin with n empty locations labeled 1, 2, …, n from L to R
Put 1 in the location number b1+1;
Put 2 in the b2+1-th empty location counting from the left;
…
k (general step): Put k in the bk+1th empty location counting from the left;
…
Put n in the remaining empty location;
the number of r-permutations of a set
n choose r
the number of r-combinations of a set
(r+k-1) choose r
total number of nonnegative integer solutions to x1+x2+…+xk = r
(r+k-1) choose r