Let m and n be positive integers. Let a1,...,am, b1,...,bn be positive integers such that a1+...+am = b1+...+bn. Show that there exists an mxn matrix, containing only zeros and ones, such that

the sum of the entries in row i is ai
the sum of the entries in column j is bj


(this is similar to exercise 21.5 on page 366).

Sorry! This statement is false. For example, taking a=b=(5,1), there is no 2x2 matrix containing only zeros and ones such that the sum of the entries in the first row and column is 5 and the sum of the entries in the second row and column is 1.

Consider the following sets:
S1 = {a,c,d}, S2 = {b,e,f}, S3 = {c,h}, S4 = {d,h}, S5 = {e,g}, S6 = {f}, S7 = {a,b}
It is desired to find a system of distinct representatives (that is to pick 7 distinct elements from the 7 sets). The constructive "marriage algorithm" can be adopted to this purpose. Suppose that it is being used, and that it starts out by picking a from S1, b from S2, c from S3, d from S4, e from S5, and f from S6. Show how the algorithm would finish up the job.



Suppose that the constructive marriage algorithm is used in an attempt to marry b "boys" to g "girls", but that it is impossible to do so. How will this failure manifest itself during the execution of the algorithm? What information does the algorithm provide at the moment when it becomes evident that it is not possible to marry all of the boys?