wu :: forums (http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi)
riddles >> cs >> The phone number problem
(Message started by: azhenfeixue on Sep 26th, 2008, 1:02am)

Title: The phone number problem
Post by azhenfeixue on Sep 26th, 2008, 1:02am
Suppose our mobile phone has 9 buttons ,which the charactors are on them(like button with "1" has the charactor string "abc").Now we have the frequency of each charactor(like 'a'=%2....'z'=%5 for example) ,the question is how we arrange the charactor to the 9 button can make user press the least times when he sending messages? Please note that if the button 1 is with "abc" , and we want to press b ,we had to press it for 2 times.And the order of the charactor should be kept(from 'a' to 'z',not allow 'c' precede 'b' for example).
I don't have a good idea to solve it properly, does anyone have?

Please pay attention to that: the order of the charactor should be kept!

Title: Re: The phone number problem
Post by towr on Sep 26th, 2008, 5:29am
You could evaluate each distribution of characters over keys for a representative sample text.



Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board