![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On 09/22/09 15:44, clipka wrote:
> Thus, the number of trailing zeros can be expressed as:
>
> floor(n/5) + floor (n/(5^2)) + floor(n/(5^3)) + ...
>
> which is a perfectly valid, non-recursive (albeit infinite) mathematical
> formula for the desired thing. (Unfortunately the floor() function
While he didn't state it in his original phrasing, he meant closed form.
--
I think animal testing is a terrible idea. They get all nervous and give
the wrong answers.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Neeum Zawan schrieb:
> On 09/22/09 15:44, clipka wrote:
>> Thus, the number of trailing zeros can be expressed as:
>>
>> floor(n/5) + floor (n/(5^2)) + floor(n/(5^3)) + ...
>>
>> which is a perfectly valid, non-recursive (albeit infinite) mathematical
>> formula for the desired thing. (Unfortunately the floor() function
>
> While he didn't state it in his original phrasing, he meant closed
> form.
This being a mathematical puzzle, I'm adhering to the /definition/, not
the /intention/ :-P
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
andrel <a_l### [at] hotmail com> wrote:
> >> 8 is less than 24
> >
> > So? How does that answer the question?
> that is obvious, I would think.
Care to explain? It's not obvious to me.
> Ok I read that wrong. Can you give an algorithm for 'and so on'?
"I said it's <n> of <n*2-1>" with consecutive values of n.
> No it has 2 both 10 and 5 have a factor of 5. So if you want your
> algorithm:
> sum_k floor(x/(5^k)) over all k from 1 till 5^k<=x
But I want a closed-form function, not a recursive function or summation.
--
- Warp
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Neeum Zawan <m.n### [at] ieee org> wrote:
> On 09/22/09 15:44, clipka wrote:
> > Thus, the number of trailing zeros can be expressed as:
> >
> > floor(n/5) + floor (n/(5^2)) + floor(n/(5^3)) + ...
> >
> > which is a perfectly valid, non-recursive (albeit infinite) mathematical
> > formula for the desired thing. (Unfortunately the floor() function
> While he didn't state it in his original phrasing, he meant closed form.
If we allow recursive functions, then the simplest answer would be:
f(0) = 0
f(n) = floor(n/5) + f(floor(n/5))
--
- Warp
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
clipka <ano### [at] anonymous org> wrote:
> > 3) Assume two people, person A and person B, who want to decide who gets
> > a price by tossing a coin.
> >
> > Person A is a bad loser and a bully, so if he loses he says "I said it's
> > two out of three". So they play it like that. If A loses again, he says
> > "I said it's three out of five", and so on, until he wins.
> >
> > How many tosses is this game expected to last, in average?
> I think that very much depends on whether the sequence is
> 1 - 3 - 5 - 7 - 9 - ...
> or
> 1 - 3 - 5 - 9 - 17 - ...
How would "four out of nine" work? If there are nine tosses, four wins
wouldn't yet be decisive.
Of course it's "4 out of 7", "5 out of 9", "6 out of 11" and so on.
--
- Warp
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On 23-9-2009 21:02, Warp wrote:
> andrel <a_l### [at] hotmail com> wrote:
>>>> 8 is less than 24
>>> So? How does that answer the question?
>
>> that is obvious, I would think.
>
> Care to explain? It's not obvious to me.
See Tim Cook.
>> Ok I read that wrong. Can you give an algorithm for 'and so on'?
>
> "I said it's <n> of <n*2-1>" with consecutive values of n.
where? This formula does not match your problem for n=1.
Strange bully to incrementally decrease his changes.
Or am I still not getting it?
>> No it has 2 both 10 and 5 have a factor of 5. So if you want your
>> algorithm:
>> sum_k floor(x/(5^k)) over all k from 1 till 5^k<=x
>
> But I want a closed-form function, not a recursive function or summation.
>
you said you didn't want a recursive function. You never said anything
about summations.
I am afraid we enter into a semantic discussion here, where I might take
another POV than you about what is a closed-form. I'll for the moment
assume that you had stated it as you have now modified it and think again.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On 23-9-2009 22:22, andrel wrote:
> On 23-9-2009 21:02, Warp wrote:
>> andrel <a_l### [at] hotmail com> wrote:
>
>>> Ok I read that wrong. Can you give an algorithm for 'and so on'?
>>
>> "I said it's <n> of <n*2-1>" with consecutive values of n.
>
> where? This formula does not match your problem for n=1.
> Strange bully to incrementally decrease his changes.
> Or am I still not getting it?
Am was indeed not getting it.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
andrel <a_l### [at] hotmail com> wrote:
> > "I said it's <n> of <n*2-1>" with consecutive values of n.
> where? This formula does not match your problem for n=1.
> Strange bully to incrementally decrease his changes.
> Or am I still not getting it?
The game starts with "1 out of 2" (regular coin toss). But if the bully
loses, he declares "I said it's 2 out of 3" and the game continues. If he
loses again, he declares "I said it's 3 out of 5", and so on.
In general, when he loses the n'th time, he declares "I said it's <n+1>
out of <(n+1)*2-1>".
--
- Warp
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Warp <war### [at] tag povray org> wrote:
> 3) Assume two people, person A and person B, who want to decide who gets
> a price by tossing a coin.
> Person A is a bad loser and a bully, so if he loses he says "I said it's
> two out of three". So they play it like that. If A loses again, he says
> "I said it's three out of five", and so on, until he wins.
> How many tosses is this game expected to last, in average?
Actually this problem isn't so "relatively easy" is it first seemed.
It's actually quite complicated.
AFAIK the answer lies on whether the sum of probabilities for a game
lasting a certain number of rounds forms a convergent or a divergent series.
If it forms a divergent series, then the average is infinite. However,
proving that the series is divergent is, AFAIK, not trivial at all.
Anyways, maybe you could want to consider two variants with finite
solutions:
3a) Like above, but after n losses the bully gets tired and declares himself
a winner anyways. In other words, rather than saying "I said it's <n+1> out
of <(n+1)*2-1>" he just ends the game.
Question: How many coin tosses does a game have in average, with an upper
limit of n round losses for the bully?
3b) Like 3a, but instead of tossing a coin, they play rock-paper-scissors.
How many hand throws in average does a game last with an upper limit of n
round losses for the bully?
--
- Warp
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Warp schrieb:
> The game starts with "1 out of 2" (regular coin toss).
Isn't that "1 out of 1"?
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |