Page 1 of 1
10276 - Hanoi Tower Troubles Again!
Posted: Tue Apr 08, 2003 9:49 am
by yatsen
I can find the fomula between f(x) and f(x-1) by observation.
And it really work!
But I can't prove it in math.
Can anyone prove the formula ?
Re: 10276 Hanoi Tower Troubles Again! need math proof
Posted: Sat Apr 09, 2005 3:56 pm
by shamim
yatsen wrote:I can find the fomula between f(x) and f(x-1) by observation.
And it really work!
But I can't prove it in math.
Can anyone prove the formula ?
I was wondering, what is the formula.
I got Ac using simulation.
Posted: Mon Apr 11, 2005 11:25 am
by yatsen
f = f[i-1] + ((i-1)/2+1)*2
Posted: Tue Apr 12, 2005 12:43 pm
by CDiMa
yatsen wrote:f = f[i-1] + ((i-1)/2+1)*2
You can rewrite this as f=f[i-1]+i+1 but I don't think it really works...
Ciao!!!
Claudio
Posted: Sat Jun 11, 2005 2:55 pm
by Sedefcho
You can not rewrite the formula in that way, Claudio.
That's because the division Yatsen gives in his formula
is an integer division ( 50/2 = 25, 51/2 = 25 ).
This means that if K = (i-1)/2
then 2*K is not always equal to (i-1).
Yatsen, it is interesting to know how you derived that
formula. I guess by some inductive way of thinking.
Then most probably if you want a clear mathematical
proof you should just follow your inductive way of
thinking which has helped you to derive the formula.
Seems an interesting math task though

to prove
your formula ( if it is always correct of course ).
There's still some minor chance that it works for i = 1,2,...,50
but it does not always work.
Posted: Tue Jun 14, 2005 9:33 am
by CDiMa
Sedefcho wrote:You can not rewrite the formula in that way, Claudio.
That's because the division Yatsen gives in his formula
is an integer division.
You're right, too careless of me...
Ciao!!!
Claudio
Posted: Tue Jul 24, 2007 1:44 pm
by hamedv
what's wrong with my code???
Posted: Tue Jul 24, 2007 8:05 pm
by hamedv
Finally i got ac;
for n = 2 my optput was wrong
Re: 10276 - Hanoi Tower Troubles Again!
Posted: Fri Dec 19, 2008 4:58 pm
by poixp
I have a little misunderstood. We need to put ball with number x and there are couple of pegs where it possible, should we simulate all possible placing or can we prove that any will do?
First I use simulation of all possibilities but it takes too long, than I tried to place ball on first possible place and get Ac. But, why I can do so?
Re: 10276 - Hanoi Tower Troubles Again!
Posted: Mon Nov 15, 2010 1:49 pm
by Shafaet_du
input:
output:
happy programming
