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 »

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 11:57 pm
Location: Netherlands

Re: problem 267

Post by stijn263 »

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 »

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 3:49 pm

Re: problem 267

Post by blazeiliev »

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 10:43 am
Location: Netherlands

Re: problem 267

Post by Lord_Farin »

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 3:49 pm

Re: problem 267

Post by blazeiliev »

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: 11319
Joined: Sun Mar 26, 2006 10:34 am
Location: Haren, Netherlands

Re: problem 267

Post by hk »

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 10:43 am
Location: Netherlands

Re: problem 267

Post by Lord_Farin »

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 3:49 pm

Re: problem 267

Post by blazeiliev »

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 11:21 pm

Re: problem 267

Post by tobiaso »

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 10:43 am
Location: Netherlands

Re: problem 267

Post by Lord_Farin »

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 10:01 am

Re: problem 267

Post by thundre »

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 10:43 am
Location: Netherlands

Re: problem 267

Post by Lord_Farin »

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 4:58 pm

Re: problem 267

Post by tommyjcarpenter »

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: 1928
Joined: Sat Aug 16, 2014 1:23 pm

Re: problem 267

Post by Animus »

The iteration continues with any amout of money, no rounding of the amount left (or gained) happens during the process.
walgong
Posts: 1
Joined: Mon Jan 04, 2021 6:55 am

Re: problem 267

Post by walgong »

I have a problem concerning this "maximize your chances".
Usually there is the notion of expectation value. I guess it does not apply here, as then in my opinion we would have f=1.
But what is then to be maximized? Is it the number of the different possible outcomes of the 1000 tosses where we get more than 1000000000?
Circling
Posts: 10
Joined: Wed Sep 16, 2020 7:33 am
Location: Earth
Contact:

Re: problem 267

Post by Circling »

walgong wrote: Mon Jan 04, 2021 6:59 am I have a problem concerning this "maximize your chances".
Usually there is the notion of expectation value. I guess it does not apply here, as then in my opinion we would have f=1.
But what is then to be maximized? Is it the number of the different possible outcomes of the 1000 tosses where we get more than 1000000000?
If f was 1, all your savings would be gone in a toss that comes as tails.
The chance of tails never occcuring is 1 / (2 ** 1000)

So no, f = 1 doesn't maximize the chance. In fact it actually minimizes it.
Problem 54 is terrible
Post Reply