Some random algorithmic combo
by math154, Oct 5, 2011, 12:18 AM
OK so I should actually try to improve at combo (and problem solving in general) this year...
1. (1998 C1) A rectangular array of numbers is given. In each row and each column, the sum of all numbers is an integer. Prove that each nonintegral number
in the array can be changed into either
or
so that the row-sums and column-sums remain unchanged. (Note that
is the least integer greater than or equal to
, while
is the greatest integer less than or equal to
.)
Solution
2. (2003 HMMT Guts) A teacher must divide
apples evenly among
students, where
. What is the minimal number of pieces into which she must cut the apples? (A whole uncut apple counts as one piece.)
Solution
3. (2009 AMP Team Contest) Given a set of positive integers ranging from
to
with sum no less than
, show that there exists a subset of them summing up to exactly
.
Solution
1. (1998 C1) A rectangular array of numbers is given. In each row and each column, the sum of all numbers is an integer. Prove that each nonintegral number







Solution
We want to reduce the number of non-integers while preserving row and column sums. Intuitively, if we change
to
, then if we can increase by
something else in the same row or column and keep alternately increasing/decreasing stuff, we'll eventually have to "cycle" back to
(and the cycle must have even length, since we switch between modifying in the same row and modifying in the same column).
This motivates us to take a bipartite graph
where
is the set of rows,
is the set of columns, and the grid numbers are written on corresponding edges. Furthermore, we can take out all edges with integer labels; we want to get down to zero edges. Because all rows and columns have integer sums, each vertex has degree at least
, and so we can find an (even) cycle. Then the rest is clear: taking an edge label
in the cycle that minimizes
(where
denotes the nearest integer function), we can proceed as described in the first paragraph.




This motivates us to take a bipartite graph





![$|[x]-x|$](http://latex.artofproblemsolving.com/8/3/2/832b1a21e093c0d5964563f799f428df254e5595.png)
![$[x]$](http://latex.artofproblemsolving.com/b/c/e/bceb7b14e55d33a8bca29b7863ad3cdae95afce4.png)
2. (2003 HMMT Guts) A teacher must divide



Solution
Trying some small cases really helps to find this crucial lemma...
Lemma: If
and
, then the teacher can divide
apples evenly among
students with just
pieces in all.
Proof: One way is just inducting on
. Otherwise, motivated by the previous problem, we interpret this as a bipartite graph
the edges represent the portions of apple students in
get from the vertices in
. At first, label each edge with
. We want to reduce to
edges (i.e. a tree) by modifying edges and deleting the zero labels. To this end, suppose we have a cycle
, which must be even since
is bipartite. If the edge label
minimizes
in the cycle, then change
to
or
accordingly and alternately modify the other edges in the cycle by
, preserving both the sum of edges emanating from vertices in
(which must be
) and the sum of edges emanating from vertices in
(which must be
), as well as the positiveness of the edge labels. If we change
to
in the process, then we lose at least one edge; otherwise, if we change it to
, then the vertex in
belonging to it goes from
edges (necessary to participate in the cycle) to exactly
edge (since all its other edges must become
), and we still lose at least one edge. Clearly this process terminates when we reach a tree of
vertices, as desired.
Let
for
, so
. The bipartite graph
only has connected components with
vertices in
and
vertices in
with
and thus at least
edges for some
. Since the sum of all such
is
, there are at most
components and thus at least
edges, with equality achievable by the lemma.
Lemma: If





Proof: One way is just inducting on



























Let















3. (2009 AMP Team Contest) Given a set of positive integers ranging from




Solution
Induction is clearly the most natural path, as long as we find a reasonable way to go down from
and
to
and
.
Lemma: Given
integers, we can find
of them with sum divisible by
.
Proof: Well-known pigeonhole on partial sums
.
Directly using this lemma and inducting does not work, because we can be left with
numbers in
. However,
is quadratic, so with a little fiddling we weaken the hypothesis to "
," with the base case
being clear. Now it works smoothly, since if we use the lemma to break our set into groups of
numbers with sum both divisible by
and at most
(first we put the
's in their own groups, and then just work with the numbers in
), then dividing each of these groups' sums by
, we have a new sum at least
for
, as desired.
![$[1,n]$](http://latex.artofproblemsolving.com/2/2/4/2240bb122bdadbe086c0a6291dcd5a3eb82ad5cf.png)

![$[1,n-1]$](http://latex.artofproblemsolving.com/e/7/c/e7c5a216a27ca8989a4b10833843b5d9eefbe9c9.png)

Lemma: Given



Proof: Well-known pigeonhole on partial sums


Directly using this lemma and inducting does not work, because we can be left with

![$[1,n-1]$](http://latex.artofproblemsolving.com/e/7/c/e7c5a216a27ca8989a4b10833843b5d9eefbe9c9.png)







![$[1,n-1]$](http://latex.artofproblemsolving.com/e/7/c/e7c5a216a27ca8989a4b10833843b5d9eefbe9c9.png)

![\[\left\lceil{\frac{2n!-n-(n-1)^2}{n}}\right\rceil = 2(n-1)!-(n-1),\]](http://latex.artofproblemsolving.com/d/1/3/d13dcf0aba7ebcd423e94b63696890776c48888d.png)

This post has been edited 3 times. Last edited by math154, Jul 27, 2012, 4:14 AM