Math-640: Bayesian Statistics
Assignment 1 Due Wed. Feb. 3
1. BDA Chapter 1, exercise 6.
Conditional probability: approximately 1/125 of all births are fraternal twins and 1/300 of births
are identical twins. Elvis Presley had a twin brother (who died at
timeit.timeit(stmt=s, setup="from _main_
import do_matrix", number=100) print
"num_rows=", num_rows, " seconds=", t then
Python will time the program. Here is the
output from a timed test run. num_rows= 10
seconds= 0.0162539482117 num_rows= 20
seconds= 0.
and only one way. Therefore the summation in
() is in fact a sum over all permutations,
taken once and only once. d(T) = X perm
t1,(1) ti,(i) tj,(j) tn,(n)
sgn() = X perm t1,(1) tj,(j) ti,(i)
tn,(n) sgn() Thus d(T) = d(T). Finally,
for condition (1) su
x y 1 x1 y1 1 x2 y2 1 ) = 0 x1 6= x2 X 1.11
Many people know this mnemonic for the
determinant of a 33 matrix: first repeat the
first two columns and then sum the products
on the forward diagonals and subtract the
products on the backward diagonals. That
|Mi(k)S| = k |S|. But |Mi(k)| = k, again by
the third condition because Mi(k) is derived
from the identity by multiplication of row i by
k. Thus |ES| = |E| |S| holds for E = Mi(k).
QED 1.6 Example Application of the map t
represented with respect to the s
change sign. Obviously we finish by comparing
det(T) with det(T) for the operation of
multiplying a row by a scalar. This det( a b kc
kd! ) = a(kd) (kc)b = k (ad bc) ends with
the entire determinant multiplied by k, and
the other 22 case has the same resu
area of the triangle in that plane?) X 1.25 An
alternate proof of Theorem 1.5 uses the
definition of determinant functions. (a) Note
that the vectors forming S make a linearly
dependent set if and only if |S| = 0, and check
that the result holds in this c
8 9 X 1.15 Find the inverse of each matrix
in the prior question with Theorem 1.9. 1.16
Find the matrix adjoint to this one. 2 1 0
0 1 2 1 0 0 1 2 1 0 0 1 2 X 1.17 Expand
across the first row to derive the formula for
the determinant of a 22 matrix. X 1.1
the bottom are all of the ways of picking one
entry of T from each column and row, so of
course they are the same set. Next observe
that in the two expansions, each t-product
expression is not necessarily associated with
the same permutation matrix. For i
random_matrix(num_rows, num_cols): m = []
for col in range(num_cols): new_row = [] for
row in range(num_rows):
new_row.append(random.uniform(0,100)
m.append(new_row) return m def
gauss_method(m): "Perform Gauss's
Method on m. This code is for illustration
Definition The signum of a permutation sgn()
is 1 if the number of inversions in is odd
and is +1 if the number of inversions is even.
4.8 Example Using the notation for the 3permutations from Example 3.8 we have P1 =
1 0 0 0 1 0 0 0 1 P2 = 1 0 0 0 0
1 0
of determinants that should apply to any
function measuring the size of a box is that it is
unaffected by row combinations. Here are
before-combining and after-combining boxes
(the scalar shown is k = 0.35). ~v w~ ~v k~v +
w~ The box formed by v and k~v +
determinants. To finish, bring vi and wi back
inside in front of the ~ s and use row
combinations again, this time to reconstruct
the expressions of ~v and w~ in terms of the
basis. That is, start with the operations of
adding v1~1 to vi~ and w1~1 to wi~1
somewhat annoying. It means we have to keep
track of the number of swaps, to compute how
the sign alternates. Can we get rid of it? Can
we replace it with the condition that row
swaps leave the determinant unchanged? (If
so then we would need new 11, 22,
is zero (although the two could differ in sign or
magnitude). A nonsingular matrix T GaussJordan reduces to an identity matrix and so
has a nonzero determinant. A singular T
reduces to a T with a zero row; by the second
sentence of this lemma its determin
Proof For the first statement, transposing the
matrix results in a matrix with the same
determinant, and with two equal rows, and
hence a determinant of zero. Prove the other
two in the same way. QED We finish this
subsection with a summary: determinant
f
the sum, over all permutations , of terms
having the form t1,(1)t2,(2) tn,(n) |
P|. 330 Chapter Four. Determinants 3.13
Example The familiar 22 determinant formula
follows from the above t1,1 t1,2 t2,1 t2,2
= t1,1t2,2 |P1 | + t1,2t2,1 |P2 | =
t1,1t2,2 1 0
even number of swaps then we would have
the determinant giving two different outputs
from a single input. Below, Corollary 4.5
proves that this cannot happen there is no
permutation matrix that can be row-swapped
to an identity matrix in two ways, one wit
region in the plane x1 y1 x2 y2 is equal to
the value of this determinant. det( x1 x2 y1 y2
) Compare with this. det( x2 x1 y2 y1 ) 1.15
Prove that for 22 matrices, the determinant
of a matrix equals the determinant of its
transpose. Does that also hold f
signum of the n-permutation = hn, n
1, . . . , 2, 1i? 4.16 Prove these. (a) Every
permutation has an inverse. (b) sgn(1 ) =
sgn() (c) Every permutation is the inverse of
another. 4.17 Prove that the matrix of the
permutation inverse is the transpose of t
3 + x2 1 1 = 6 2 8 1 Solving gives the
value of one of the variables. x1 = 6 2 8 1
1 2 3 1 = 10 5 = 2 The generalization of
this example is Cramers Rule: if |A| 6= 0 then
the system A~x = ~b has the unique solution xi
= |Bi|/|A| where the matrix Bi is for
that takes time proportional to the cube. First
consider the permutation expansion formula.
t1,1 t1,2 . . . t1,n t2,1 t2,2 . . . t2,n . . . tn,1
tn,2 . . . tn,n
= X permutations
t1,(1)t2,(2) tn,(n) |P| There are n! =
n (n 1) 2 1 different n-permutations
Fibonacci sequence, and the determinant is of
order n 1. [Am. Math. Mon., Jun. 1949] Topic
Cramers Rule A linear system is equivalent to
a linear relationship among vectors. x1 + 2x2 =
6 3x1 + x2 = 8 x1 1 3 ! + x2 2 1 ! = 6 8 ! In
the picture below the sm
Determinants are multilinear. Proof Property
(2) here is just Definition 2.1s condition (3) so
we need only verify property (1). There are
two cases. If the set of other rows cfw_~1, . . . ,
~i1, ~i+1, . . . , ~n is linearly dependent
then all three matr
terms in square brackets involve only the
second and third row and column, and simplify
to a 22 determinant. = t1,1 t2,2 t2,3 t3,2
t3,3 t1,2 t2,1 t2,3 t3,1 t3,3 + t1,3
t2,1 t2,2 t3,1 t3,2 The formula given in
Theorem 1.5, which generalizes this example,
= 10 1 4 3 2 = 10 Swapping the columns
changes the sign. On the left, starting with ~u
and following the arc inside the angle to ~v
(that is, going counterclockwise), we get a
positive size. On the right, starting at ~v and
going to ~u, and so following t
we havent yet shown that such a function
exists for all n. The rest of this section does
that. Exercises For these, assume that an nn
determinant function exists for all n. X 2.8 Use
Gausss Method to find each determinant. (a)
312310014
(b)
1 0 0 1 2 1 1
|t(S)| is |T| times the size of the box |S|,
where T is the matrix representing t with
respect to the standard basis. That is, the
determinant of a product is the product of the
determinants |TS| = |T| |S|. The two
sentences say the same thing, first in m
we will write it as a function of the rows
det(~1, ~2, . . . ~n), rather than as det(T) or
as a function of the entries det(t1,1, . . . , tn,n).
Exercises X 1.1 Evaluate the determinant of
each. (a) 3 1 1 1 (b) 2 0 1 3 1 1 1 0 1
(c) 4 0 1 0 0 1 1 3 1 1.2
+ k2f(~1, . . . ,~v2, . . . , ~n) 3.23 How would
determinants change if we changed property
(4) of the definition to read that |I| = 2? 3.24
Verify the second and third statements in
Corollary 3.16. X 3.25 Show that if an nn
matrix has a nonzero determina
from the construction of the sum of the two
vectors. x1 y1 x2 y2 1.1 Definition In R n the
box (or parallelepiped) formed by h~v1, . . .
,~vni is the set cfw_t1~v1 + + tn~vn | t1, . . . ,
tn [0 . . . 1]. Thus the parallelogram above
is the box formed by h
matrices that we will see. 2.5 Example Doing
22 determinants with Gausss Method 2 4
1 3 = 2 4 0 5 = 10 doesnt give a big
time savings because the 22 determinant
formula is easy. However, a 33 determinant is
often easier to calculate with Gausss Method
tha
. has the value unity. I.4 Determinants Exist
This subsection contains proofs of two results
from the prior subsection. It is optional. We
will use the material developed here only in
the Jordan Canonical Form subsection, which
is also optional. We wish t