MathDB
Old Persia

Source: Iranian National Olympiad (3rd Round) 2002

October 6, 2006
combinatorics proposedcombinatorics

Problem Statement

15000 years ago Tilif ministry in Persia decided to define a code for n2n\geq2 cities. Each code is a sequence of 0,10,1 such that no code start with another code. We know that from 2m2^{m} calls from foreign countries to Persia 2mai2^{m-a_{i}} of them where from the ii-th city (So i=1n12ai=1\sum_{i=1}^{n}\frac1{2^{a_{i}}}=1). Let lil_{i} be length of code assigned to ii-th city. Prove that i=1nli2i\sum_{i=1}^{n}\frac{l_{i}}{2^{i}} is minimum iff i, li=ai\forall i,\ l_{i}=a_{i}