POV-Ray : Newsgroups : povray.off-topic : Some math problems Server Time
5 Sep 2024 07:22:45 EDT (-0400)
  Some math problems (Message 11 to 20 of 32)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Sabrina Kilian
Subject: Re: Some math problems
Date: 22 Sep 2009 23:36:31
Message: <4ab997bf$1@news.povray.org>
clipka wrote:
> Warp schrieb:
>>   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 - ...
> 
> 
I didn't look at the other puzzles, but this one sounds easy enough to
work with before sleep.

First round, A claims 'heads I win' so could win 50% of the time.
Each time B gets a tail flip, A increments how many are needed to win.

Best N out of 2N-1.

Okay, A stands to win first round 50% of the time.
Second round, A can not win because he obviously lost first round.
Third round, A has a remaining 50% chance to win if he won either
previous, a 0 if not.

Just going on brain alone, and barely any of that since it is late here.
But it seems that if the game progresses past the first round, it has a
high chance of going on forever. Same for any of the loss points after
that. Average of 1 + infinity is somewhat closer to infinity than to
one. I would say the game in unwinnable.

The other option is that Player B just needs to punch A, take the coin
and walk away. At least he wins a coin, this way.


Post a reply to this message

From: Sabrina Kilian
Subject: Re: Some math problems
Date: 23 Sep 2009 00:04:45
Message: <4ab99e5d$1@news.povray.org>
Warp wrote:
>   4) By their nature, factorials tend to accumulate trailing zeroes. For
> example, 5! (120) has one trailing zero, 10! (3628800) has two trailing
> zeroes, 25! (15511210043330985984000000) has six trailing zeroes, etc.
> 
>   Give a (non-recursive) mathematical function which, for an integer n,
> gives the number of trailing zeroes in n!.
> 

I think I have a numerical solution, but I do not have the formulas to
write the equation. Yet. . .

What you are interested in is the number of numbers, less than n, that
end in 5, or 0. Five times any even number will result in a multiple of
10 and have add zero at the end. All factorials after 2! are even, given
that 2 is even and they are all multiplied by 2 by recursion.

So, to solve for the number of integers that are multiples of 10, X =
floor(N/10), but save the remainder of N/10 as R. Y, the number of
integers <N ending in 5s, can be gotten via R. Y = floor(R/5)+X. Number
of zeros would be X + Y.


Post a reply to this message

From: Neeum Zawan
Subject: Re: Some math problems
Date: 23 Sep 2009 00:06:51
Message: <4ab99edb$1@news.povray.org>
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

From: clipka
Subject: Re: Some math problems
Date: 23 Sep 2009 09:06:41
Message: <4aba1d61$1@news.povray.org>
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

From: Warp
Subject: Re: Some math problems
Date: 23 Sep 2009 15:02:22
Message: <4aba70be@news.povray.org>
andrel <a_l### [at] hotmailcom> 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

From: Warp
Subject: Re: Some math problems
Date: 23 Sep 2009 15:18:32
Message: <4aba7488@news.povray.org>
Neeum Zawan <m.n### [at] ieeeorg> 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

From: Warp
Subject: Re: Some math problems
Date: 23 Sep 2009 15:22:30
Message: <4aba7576@news.povray.org>
clipka <ano### [at] anonymousorg> 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

From: andrel
Subject: Re: Some math problems
Date: 23 Sep 2009 16:22:29
Message: <4ABA8384.2000000@hotmail.com>
On 23-9-2009 21:02, Warp wrote:
> andrel <a_l### [at] hotmailcom> 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

From: andrel
Subject: Re: Some math problems
Date: 23 Sep 2009 16:27:38
Message: <4ABA84B9.3070809@hotmail.com>
On 23-9-2009 22:22, andrel wrote:
> On 23-9-2009 21:02, Warp wrote:
>> andrel <a_l### [at] hotmailcom> 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

From: Warp
Subject: Re: Some math problems
Date: 23 Sep 2009 16:44:09
Message: <4aba8899@news.povray.org>
andrel <a_l### [at] hotmailcom> 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

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.