Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > deal or no deal

Reply
Thread Tools

deal or no deal

 
 
rbt
Guest
Posts: n/a
 
      12-22-2005
The house almost always wins or are my assumptions wrong...

import random

amounts = [.01, 1, 5, 10, 25, 50, 75, 100, 200, 300, 400, 500, 750,
1000, 5000, 10000, 25000, 50000, 75000, 100000, 200000,
300000, 400000, 500000, 750000, 1000000]

results = []

count = 0
while count < 10:
count = count + 1
pick = random.choice(amounts)
if pick < 100000:
results.append("NBC won... Your briefcase contains $%s" %pick)
else:
results.append("You won... Your briefcase contains $%s" %pick)

results.sort()
print "Here are 10 random picks: "
for result in results:
print result
 
Reply With Quote
 
 
 
 
Bengt Richter
Guest
Posts: n/a
 
      12-22-2005
On Thu, 22 Dec 2005 09:29:49 -0500, rbt <(E-Mail Removed)> wrote:

>The house almost always wins or are my assumptions wrong...
>
>import random
>
>amounts = [.01, 1, 5, 10, 25, 50, 75, 100, 200, 300, 400, 500, 750,
> 1000, 5000, 10000, 25000, 50000, 75000, 100000, 200000,
> 300000, 400000, 500000, 750000, 1000000]
>
>results = []
>
>count = 0
>while count < 10:
> count = count + 1
> pick = random.choice(amounts)
> if pick < 100000:
> results.append("NBC won... Your briefcase contains $%s" %pick)
> else:
> results.append("You won... Your briefcase contains $%s" %pick)
>
>results.sort()
>print "Here are 10 random picks: "
>for result in results:
> print result


I don't know what you are doing, but 10 is a small sample to draw confident
conclusions from. E.g., try counting how many times pick<100000 out of
a larger number, e.g.,

(BTW, the expression x<y has the value True or False, and True and False are
int subclass instances with int values 1 and 0 respectively, so the sum below
is adding 1 whenever random.choice(amounts)<100000 and 0 otherwise)

>>> import random
>>> amounts = [.01, 1, 5, 10, 25, 50, 75, 100, 200, 300, 400, 500, 750,

... 1000, 5000, 10000, 25000, 50000, 75000, 100000, 200000,
... 300000, 400000, 500000, 750000, 1000000]
>>> sum(random.choice(amounts)<100000 for _ in xrange(1000))

736
>>> sum(random.choice(amounts)<100000 for _ in xrange(1000))

734
>>> sum(random.choice(amounts)<100000 for _ in xrange(1000))

730
>>> sum(random.choice(amounts)<100000 for _ in xrange(1000))

721
>>> sum(random.choice(amounts)<100000 for _ in xrange(1000))

753

What should the sum be?

>>> amounts.index(100000)

19
is the number of numbers < 100000 in amounts

>>> len(amounts)

26
is the total number of numbers

So if you choose with uniform probability, you'd expect
>>> 19./26

0.73076923076923073

to be the fraction satisfying pick<100000

With a larger sample, the fraction should show better, e.g.,

>>> sum(random.choice(amounts)<100000 for _ in xrange(1000000))

730983

Does that help?

Regards,
Bengt Richter
 
Reply With Quote
 
 
 
 
rbt
Guest
Posts: n/a
 
      12-22-2005
Bengt Richter wrote:
> On Thu, 22 Dec 2005 09:29:49 -0500, rbt <(E-Mail Removed)> wrote:
>
>> The house almost always wins or are my assumptions wrong...
>>
>> import random
>>
>> amounts = [.01, 1, 5, 10, 25, 50, 75, 100, 200, 300, 400, 500, 750,
>> 1000, 5000, 10000, 25000, 50000, 75000, 100000, 200000,
>> 300000, 400000, 500000, 750000, 1000000]
>>
>> results = []
>>
>> count = 0
>> while count < 10:
>> count = count + 1
>> pick = random.choice(amounts)
>> if pick < 100000:
>> results.append("NBC won... Your briefcase contains $%s" %pick)
>> else:
>> results.append("You won... Your briefcase contains $%s" %pick)
>>
>> results.sort()
>> print "Here are 10 random picks: "
>> for result in results:
>> print result

>
> I don't know what you are doing, but 10 is a small sample to draw confident
> conclusions from. E.g., try counting how many times pick<100000 out of
> a larger number, e.g.,


The TV show on NBC in the USA running this week during primetime (Deal
or No Deal). I figure there are roughly 10, maybe 15 contestants. They
pick a briefcase that has between 1 penny and 1 million bucks and then
play this silly game where NBC tries to buy the briefcase from them
while amounts of money are taken away from the list of possibilities.
The contestant's hope is that they've picked a briefcase with a lot of
money and that when an amount is removed from the list that it is small
amount of money not a large amount (I categorize a large amount to be
more than 100,000)

NBC tries to give the least amount of money possible away. The
contestants try to get the most.

> What should the sum be?


100,000 or above unless you're already rich


 
Reply With Quote
 
Rocco Moretti
Guest
Posts: n/a
 
      12-22-2005
rbt wrote:

> The TV show on NBC in the USA running this week during primetime (Deal
> or No Deal). I figure there are roughly 10, maybe 15 contestants. They
> pick a briefcase that has between 1 penny and 1 million bucks and then
> play this silly game where NBC tries to buy the briefcase from them
> while amounts of money are taken away from the list of possibilities.
> The contestant's hope is that they've picked a briefcase with a lot of
> money and that when an amount is removed from the list that it is small
> amount of money not a large amount (I categorize a large amount to be
> more than 100,000)


Well, if the contestants' choices are truly random, and they stick with
their first choice all the way to the end, each contestant wins, on
average, $131 477.54 (sum(amounts)/len(amounts)).

Assuming that the buyout offer is always less than (or equal to) the
average of the still-available amounts, NBC will (on average) never have
to pay out more than ~$132k per contestant. Likely they'll pay out less,
because most people will get nervous before the very end, and will take
the low ball offer NBC is fronting.

What I would really like to know, is how they calculate the offer.
Obviously, they set the upper limit at the average of the still standing
offers, but I wonder if and how they take subsequent rounds into
consideration. Is there a "Monty Hall"
(http://en.wikipedia.org/wiki/Monty_Hall_problem) type consideration
that needs to be taken into effect as cases are eliminated?
 
Reply With Quote
 
Duncan Smith
Guest
Posts: n/a
 
      12-25-2005
Rocco Moretti wrote:
> rbt wrote:
>
>> The TV show on NBC in the USA running this week during primetime (Deal
>> or No Deal). I figure there are roughly 10, maybe 15 contestants. They
>> pick a briefcase that has between 1 penny and 1 million bucks and then
>> play this silly game where NBC tries to buy the briefcase from them
>> while amounts of money are taken away from the list of possibilities.
>> The contestant's hope is that they've picked a briefcase with a lot of
>> money and that when an amount is removed from the list that it is
>> small amount of money not a large amount (I categorize a large amount
>> to be more than 100,000)

>
>
> Well, if the contestants' choices are truly random, and they stick with
> their first choice all the way to the end, each contestant wins, on
> average, $131 477.54 (sum(amounts)/len(amounts)).
>
> Assuming that the buyout offer is always less than (or equal to) the
> average of the still-available amounts, NBC will (on average) never have
> to pay out more than ~$132k per contestant. Likely they'll pay out less,
> because most people will get nervous before the very end, and will take
> the low ball offer NBC is fronting.
>
> What I would really like to know, is how they calculate the offer.
> Obviously, they set the upper limit at the average of the still standing
> offers, but I wonder if and how they take subsequent rounds into
> consideration.


I've seen them offer more than the average towards the end of the game
(UK version).

Duncan
 
Reply With Quote
 
james.moughan@sunderland.ac.uk
Guest
Posts: n/a
 
      12-26-2005

[snip]
>
> What I would really like to know, is how they calculate the offer.
> Obviously, they set the upper limit at the average of the still standing
> offers, but I wonder if and how they take subsequent rounds into
> consideration. Is there a "Monty Hall"
> (http://en.wikipedia.org/wiki/Monty_Hall_problem) type consideration
> that needs to be taken into effect as cases are eliminated?


I believe not; the Monty Hall problem is biased by the fact that the
presenter knows where the prize is, and eliminates one box accordingly.
Where boxes are eliminated at random, it's impossible for any given
box to have a higher probability of containing any given amount of
money than another. And for the contestants box to be worth more or
less than the mean, it must have a higher probability of containing a
certain amount.

Like another member of the group, I've seen them offer more than the
average on the UK version, which puzzled me quite a lot.

James M

 
Reply With Quote
 
Chip Turner
Guest
Posts: n/a
 
      12-26-2005
On 2005-12-26 15:05:21 -0500, http://www.velocityreviews.com/forums/(E-Mail Removed) said:

> I believe not; the Monty Hall problem is biased by the fact that the
> presenter knows where the prize is, and eliminates one box accordingly.
> Where boxes are eliminated at random, it's impossible for any given
> box to have a higher probability of containing any given amount of
> money than another. And for the contestants box to be worth more or
> less than the mean, it must have a higher probability of containing a
> certain amount.


Agreed -- unless the presenter takes away a case based on knowledge he
has about the contents, then Monty Hall doesn't enter into it. Deal or
No Deal seems to be a purely chance based game. However, that doesn't
mean there aren't strategies beyond strictly expecting the average
payout.

> Like another member of the group, I've seen them offer more than the
> average on the UK version, which puzzled me quite a lot.


I imagine it is about risks. Many gameshows take out insurance
policies against the larger payoffs to protect the show and network
from big winners. I believe Who Wants to be a Millionaire actually had
some difficulty with their insurance when they were paying out too
often, or something. Perhaps the UK Deal or No Deal didn't want to
risk increasing their premium

But even the contestant has a reason to not just play the average,
thereby bringing psychology into the game. It comes down to the odd
phenomenon that the value of money isn't linear to the amount of money
in question. If you're playing the game, and only two briefcases are
left -- 1,000,000 and 0.01, and the house offers you 400,000... take
it! On average you'll win around 500,000, but half the time, you'll
get a penny. Averages break down when you try to apply them to a
single instance. On the flip side, if you think about how much
difference 500,000 will make in your life vs, say, 750,000, then taking
a risk to get 750,000 is probably worth it; sure, you might lose
250,000 but on top of 500,000, the impact of the loss you would suffer
is significantly lessened. In the end, it comes down to what the money
on the table means to *you* and how willing you are to lose the
guaranteed amount to take risks.

It's similar to the old game of coin flipping to double your money.
Put a dollar on the table. Flip a coin. Heads, you double your bet,
tails you lose it all. You can stop any time you want. The expected
outcome is infinite money (1 * 1/2 + 2 * 1/4 + 4 * 1/8 ...), but a
human playing it would do well to stop before the inevitable tails
comes along, even though mathematically the house pays out an expected
infinite number of dollars over time. Exponential growth in winnings
doesn't offset exponential risk in taking a loss because, once you hit
a certain point, the money on the table is worth more than the 50%
chance of having twice as much.

Chip

--
Chip Turner (E-Mail Removed)

 
Reply With Quote
 
Duncan Smith
Guest
Posts: n/a
 
      12-28-2005
Chip Turner wrote:
> On 2005-12-26 15:05:21 -0500, (E-Mail Removed) said:
>
>> I believe not; the Monty Hall problem is biased by the fact that the
>> presenter knows where the prize is, and eliminates one box accordingly.
>> Where boxes are eliminated at random, it's impossible for any given
>> box to have a higher probability of containing any given amount of
>> money than another. And for the contestants box to be worth more or
>> less than the mean, it must have a higher probability of containing a
>> certain amount.

>
>
> Agreed -- unless the presenter takes away a case based on knowledge he
> has about the contents, then Monty Hall doesn't enter into it. Deal or
> No Deal seems to be a purely chance based game. However, that doesn't
> mean there aren't strategies beyond strictly expecting the average payout.
>
>> Like another member of the group, I've seen them offer more than the
>> average on the UK version, which puzzled me quite a lot.

>
>
> I imagine it is about risks. Many gameshows take out insurance policies
> against the larger payoffs to protect the show and network from big
> winners. I believe Who Wants to be a Millionaire actually had some
> difficulty with their insurance when they were paying out too often, or
> something. Perhaps the UK Deal or No Deal didn't want to risk
> increasing their premium
>
> But even the contestant has a reason to not just play the average,
> thereby bringing psychology into the game. It comes down to the odd
> phenomenon that the value of money isn't linear to the amount of money
> in question. If you're playing the game, and only two briefcases are
> left -- 1,000,000 and 0.01, and the house offers you 400,000... take
> it! On average you'll win around 500,000, but half the time, you'll get
> a penny. Averages break down when you try to apply them to a single
> instance. On the flip side, if you think about how much difference
> 500,000 will make in your life vs, say, 750,000, then taking a risk to
> get 750,000 is probably worth it; sure, you might lose 250,000 but on
> top of 500,000, the impact of the loss you would suffer is significantly
> lessened. In the end, it comes down to what the money on the table
> means to *you* and how willing you are to lose the guaranteed amount to
> take risks.
>
> It's similar to the old game of coin flipping to double your money. Put
> a dollar on the table. Flip a coin. Heads, you double your bet, tails
> you lose it all. You can stop any time you want. The expected outcome
> is infinite money (1 * 1/2 + 2 * 1/4 + 4 * 1/8 ...), but a human playing
> it would do well to stop before the inevitable tails comes along, even
> though mathematically the house pays out an expected infinite number of
> dollars over time. Exponential growth in winnings doesn't offset
> exponential risk in taking a loss because, once you hit a certain point,
> the money on the table is worth more than the 50% chance of having twice
> as much.
>
> Chip
>


As you say, it depends on the player's utility function. But it's not a
straightforward question of comparing the offer to the expected values
of the remaining boxes, even for a risk-neutral player. At most stages
of the game refusing an offer means that there will be a future offer,
and, later in the game, these tend to be closer to (or even greater
than) the expected value.

Duncan
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
AMD64 or Semperon, deal or no deal? Tad Confused Computer Information 7 04-13-2006 05:43 PM
Passed the exam. Not a big deal for me. =?Utf-8?B?U2Vsdmk=?= Microsoft Certification 0 08-10-2005 04:24 AM
2 for 1 deal on 70-270 jb Microsoft Certification 1 04-07-2005 01:53 AM
Newbie Help: How do I deal with variable length vectors? roninn@gmail.com VHDL 5 03-28-2005 12:33 PM
simple programs to deal with data format, data synchronisation Ram VHDL 1 02-24-2005 05:34 PM



Advertisments