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

Don't post any spoilers
hisoka-san
Posts: 20
Joined: Sun Jan 25, 2009 6:14 pm

problem 267

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

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

Re: problem 267

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

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

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.

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

Re: problem 267

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.

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

Re: problem 267

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.

hk
Posts: 10403
Joined: Sun Mar 26, 2006 9:34 am
Location: Haren, Netherlands

Re: problem 267

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:

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

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

Re: problem 267

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).

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

Re: problem 267

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

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?

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

Re: problem 267

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.

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

Re: problem 267

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.

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

Re: problem 267

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

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

Re: problem 267

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?

Animus