bags and coins: hard sequences?

Max Alekseyev maxale at gmail.com
Fri Feb 8 15:17:03 CET 2008


SeqFans,

I recall the following nice problem from some programming contest.

You are given n bags with coins that are visually indistinguishable.
It is known that for every i=1,2,...,n there exists a bag such that
every coin in this bag weights i pounds, but it is NOT known what bag
contains coins of what weight.
Suppose that the bags are somehow ordered, you take m[i] coins from
the i-th bag and measure their exact total weight M with a scale. The
amounts m[1], m[2], ..., m[n] have to be chosen in such a way that
from the single measurement M (whatever it is) you will be able to
determine coins of what weight are in every bag.

There is two different constraints (thus, two different problems):

1) the sum m[1] + m[2] + ... + m[n] must be as small as possible;
denote it a(n) = min { m[1] + m[2] + ... + m[n] }.

2) the largest taken amount must as small as possible; denote it b(n)
= min max_i { m[i] }.

Note that without loss of generality we may assume that
m[1]<m[2]<...<m[n] (and furthermore, m[1]=0) so that b(n) becomes
simply min m[n].

I wonder whether sequences a(n) and b(n) are present in OEIS and if
not, whether anybody is interested in computing and submitting them.

As far as I remember, the original contest problem was for a fixed n=5
and it was already rather hard. I believe it is possible to compute
a(n) and b(n) for at least n=6 but may become intractable for n>6.
Prove me wrong.

Regards,
Max





More information about the SeqFan mailing list