problem 267

A place to air possible concerns or difficulties in understanding ProjectEuler problems. This forum is not meant to publish solutions. This forum is NOT meant to discuss solution methods or giving hints how a problem can be solved.
Forum rules
As your posts will be visible to the general public you
are requested to be thoughtful in not posting anything
that might explicitly give away how to solve a particular problem.

This forum is NOT meant to discuss solution methods for a problem.

In particular don't post any code fragments or results.

Don't start begging others to give partial answers to problems

Don't ask for hints how to solve a problem

Don't start a new topic for a problem if there already exists one


See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
Post Reply
hisoka-san
Posts: 20
Joined: Sun Jan 25, 2009 6:14 pm

problem 267

Post by hisoka-san » Fri Dec 04, 2009 2:17 pm

Say after 100 bets I have 1e9 pounds. Can I quit and take the money?

User avatar
stijn263
Posts: 1505
Joined: Sat Sep 15, 2007 10:57 pm
Location: Netherlands

Re: problem 267

Post by stijn263 » Fri Dec 04, 2009 2:34 pm

Problem 267 (View Problem) says:

you can choose a fixed proportion, f, of your capital to bet on a fair coin toss repeatedly for 1000 tosses.

So, no you can not. You bet the same fixed proportion of your capital each time. Good luck :-)

hisoka-san
Posts: 20
Joined: Sun Jan 25, 2009 6:14 pm

Re: problem 267

Post by hisoka-san » Fri Dec 04, 2009 3:15 pm

what I didn't take into account that in case of win, bet amount is returned. Thanks

blazeiliev
Posts: 3
Joined: Mon May 30, 2011 2:49 pm

Re: problem 267

Post by blazeiliev » Mon May 30, 2011 2:55 pm

I'm troubled with the text of problem 267. It says

"...For example, if f = 1/4, for the first toss you bet £0.25, and if heads comes up you win £0.5 and so then have £1.5. You then bet £0.375 and..."

How come from having £1 you end up having £1.5? If you bet £0.25 and win, you should have £1.25.

User avatar
Lord_Farin
Posts: 239
Joined: Wed Jul 01, 2009 9:43 am
Location: Netherlands

Re: problem 267

Post by Lord_Farin » Mon May 30, 2011 4:33 pm

blazeiliev wrote:I'm troubled with the text of problem 267. It says

"...For example, if f = 1/4, for the first toss you bet £0.25, and if heads comes up you win £0.5 and so then have £1.5. You then bet £0.375 and..."

How come from having £1 you end up having £1.5? If you bet £0.25 and win, you should have £1.25.
Win is measured respective to the amount before betting, not that during betting. In other words, the win excludes the return of the bet.
Image

blazeiliev
Posts: 3
Joined: Mon May 30, 2011 2:49 pm

Re: problem 267

Post by blazeiliev » Mon Jun 13, 2011 10:21 am

Lord_Farin wrote:
blazeiliev wrote:I'm troubled with the text of problem 267. It says

"...For example, if f = 1/4, for the first toss you bet £0.25, and if heads comes up you win £0.5 and so then have £1.5. You then bet £0.375 and..."

How come from having £1 you end up having £1.5? If you bet £0.25 and win, you should have £1.25.
Win is measured respective to the amount before betting, not that during betting. In other words, the win excludes the return of the bet.
I'm still having trouble understanding. Can you give me an example with numbers.

User avatar
hk
Administrator
Posts: 10316
Joined: Sun Mar 26, 2006 9:34 am
Location: Haren, Netherlands

Re: problem 267

Post by hk » Mon Jun 13, 2011 10:32 am

First of all you choose a fraction f, say f=0.25.
You start having 1 pound.

So your first bet is 0.25*1=0.25.
Then we have the rule:
Your return is double your bet for heads and you lose your bet for tails.
So if you have heads your return is twice your bet=2*0.25=0.5, this is added to what you have making 1.5.

At the second toss your bet is 0.25*1.5=0.375.
If you now have tails your bet is subtracted from what you have: 1.5-0.375=1.125
Image

User avatar
Lord_Farin
Posts: 239
Joined: Wed Jul 01, 2009 9:43 am
Location: Netherlands

Re: problem 267

Post by Lord_Farin » Mon Jun 13, 2011 10:37 am

blazeiliev wrote:I'm still having trouble understanding. Can you give me an example with numbers.
Suppose we can bet £1 for a 50% chance to win £2. Then:
if we lose, we get £0
if we win, we get £3 = £1 for the return of the bet, and £2 of the win.
In other words, 'win' is synonymous to 'profit.' Or phrased differently again, 'win' = 'money after bet' - 'money before bet,' presumed this is not negative.

You can also view this as 'virtual betting' where you say you will bet £1, and if you lose, you will receive a bill for £1 representing the loss of your bet. If you win, you will get a payment of £2 (thus then you have £3).
Image

blazeiliev
Posts: 3
Joined: Mon May 30, 2011 2:49 pm

Re: problem 267

Post by blazeiliev » Wed Jun 15, 2011 9:42 am

Thanks, I think I finally got it.
You win twice your investment plus your initial bet (if you win)
and you lose only your bet (if you lose).
Makes sense to be a unique investment opportunity :-)

tobiaso
Posts: 1
Joined: Wed Sep 14, 2011 10:21 pm

Re: problem 267

Post by tobiaso » Wed Sep 14, 2011 10:24 pm

But do you have to choose your own f? Or is the given f already 1/4?
Or is the question what is the best f you can choose?

And i assume this is random, how can we know the random generator of a specific language is the same as any other one?
All throws have a random 50% chance of winning or losing, right?

User avatar
Lord_Farin
Posts: 239
Joined: Wed Jul 01, 2009 9:43 am
Location: Netherlands

Re: problem 267

Post by Lord_Farin » Thu Sep 15, 2011 3:08 pm

tobiaso wrote:But do you have to choose your own f? Or is the given f already 1/4?
Or is the question what is the best f you can choose?

And i assume this is random, how can we know the random generator of a specific language is the same as any other one?
All throws have a random 50% chance of winning or losing, right?
The fraction f is uniquely determined by having the stated maximality property. Using it, calculate the desired probability.
The randomness is assumed to be mathematical randomness. This is different from the pseudorandomness any computable algorithm gives. You might want to look up some information about statistics.

As a response to your last question: This would mean that the probability of throwing a 1 or not with a fair die are both 50%. You will probably agree such is not the case... But again, look up some statistics.
Image

thundre
Posts: 356
Joined: Sun Mar 27, 2011 9:01 am

Re: problem 267

Post by thundre » Fri Sep 16, 2011 2:04 pm

Lord_Farin wrote:The fraction f is uniquely determined by having the stated maximality property.
False. f is a real number, and there is an interval which yields the maximum probability.
tobiaso wrote:All throws have a random 50% chance of winning or losing, right?
Right.
Image

User avatar
Lord_Farin
Posts: 239
Joined: Wed Jul 01, 2009 9:43 am
Location: Netherlands

Re: problem 267

Post by Lord_Farin » Sat Sep 17, 2011 8:52 am

I apologise for posting blatant lies. I should read the problem description more carefully the next time somebody asks a question.
Image

tommyjcarpenter
Posts: 3
Joined: Wed May 03, 2017 3:58 pm

Re: problem 267

Post by tommyjcarpenter » Thu Jan 03, 2019 4:55 pm

Is the smallest denomination possible considered to be .01? Meaning, if f is .5, and you have .01 remaining, you bet and lose, does the iteration continue with having .005 of money?

If not, what is the smallest denomination of money that is considered > 0?

User avatar
Animus
Administrator
Posts: 1531
Joined: Sat Aug 16, 2014 12:23 pm

Re: problem 267

Post by Animus » Thu Jan 03, 2019 5:12 pm

The iteration continues with any amout of money, no rounding of the amount left (or gained) happens during the process.

Post Reply