Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Fourier Transfer and a game?!?!

  • To: mathgroup at smc.vnet.net
  • Subject: [mg54207] Re: Fourier Transfer and a game?!?!
  • From: Maxim <ab_def at prontomail.com>
  • Date: Sun, 13 Feb 2005 00:21:36 -0500 (EST)
  • Organization: MTU-Intel ISP
  • References: <cuf5kg$god$1@smc.vnet.net> <cukb23$lmi$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

On Sat, 12 Feb 2005 07:25:55 +0000 (UTC), Maxim <ab_def at prontomail.com>  
wrote:

> On Thu, 10 Feb 2005 08:22:40 +0000 (UTC), elparedblanco
> <cire1611 at gmail.com> wrote:
>
>> let's say we have a probabability of picking an amount of money from a
>> vat.  I can go into the vat either 0,1,2,3 times.  The probability with
>> which I pick from the vat is described by the vector {.4, .35,.15,.1}.
>> I call this frequency.
>>
>> I can pull only four amounts of money from the vat.  The amounts are
>> {$2500,$5000,$7500,$10000}.  The probability of picking each amount is
>> described by the vector {.35,.35,.15,.15}. I call this severity1.
>>
>> Process is this.  First I choose how many times I can go into the vat.
>> Then I go in that many times.  I always replace what I pick out.  so it
>> is possible to win $30000.
>>
>> The Question is what's the probabililty of winning certain amounts of
>> money, such as 15,000 or 7,500 or any number, given the fact that I can
>> pick multiple times?
>>
>
>>
>> ANSWER = {.4000, .1225, .1409, .0935, .0995, .0499, .040, .0257, .016,
>> .0074 .0034, .0010, .0003}
>>
>
> Suppose we have a model with three vats which open independently with
> probabilities p1, p2, p3 respectively. Then the generating function (GF)
> for the amount of money taken from the first vat is ((1 - p1)
> + p1*(.35*z^2500 + .35*z^5000 +.15*z^7500 + .15*z^10000)), and similarly
> for the other vats. Of course then the solution would be simple, because
> to find the GF for the sum taken from the three vats we just have to
> multiply the three GFs. So if we could find p1, p2, p3 such that the
> probability of all three vats opening, which is p1*p2*p3, equals .1 and
> the equations for other combinations hold as well, we would be done.
>
> In[1]:=
> sol = Solve[
>    {(1 - p1)*(1 - p2)*(1 - p3) == .4,
>     p1*(1 - p2)*(1 - p3) + (1 - p1)*p2*(1 - p3) +
>       (1 - p1)*(1 - p2)*p3 == .35,
>     p1*p2*(1 - p3) + p1*(1 - p2)*p3 + (1 - p1)*p2*p3 == .15},
>    {p1, p2, p3}][[1]]
>
> Out[1]=
> {p1 -> 0.253124 - 0.401596 I, p2 -> 0.253124 + 0.401596 I,
>   p3 -> 0.443751}
>
> Other solutions are just the permutations of the first one. The solution
> is complex-valued, but what if we substitute it in the GF?
>
> In[2]:=
> Module[
>    {gf = .35*z^2500 + .35*z^5000 +.15*z^7500 + .15*z^10000},
>    ((1 - p1) + p1*gf)*((1 - p2) + p2*gf)*((1 - p3) + p3*gf) /.
>      sol // Expand // Chop //
>        Replace[List @@ #,
>          {k_.*z^p_. -> {p, k}, k_ -> {0, k}},
>          {1}]&
> ]
>
> Out[2]=
> {{0, 0.4}, {2500, 0.1225}, {5000, 0.140875}, {7500, 0.0935375}, {10000,
> 0.0994875}, {12500, 0.049875}, {15000, 0.03995}, {17500, 0.02565},  
> {20000,
> 0.015975}, {22500, 0.007425}, {25000, 0.003375}, {27500, 0.0010125},
> {30000, 0.0003375}}
>
> It would be interesting to give a rigorous justification for this trick.
>
> Maxim Rytin
> m.r at inbox.ru
>

Alternatively, we can simply use the formula for the total probability

P(amount = k) =
   Sum(P(amount = k | openvats = i)*P(openvats = i), i = 0..3).

 From this we can infer that the GF for amount is .4 + .35*gf + .15*gf^2  
+.1*gf^3, arriving at the same expression for GF as above without the  
intermediate step of finding p1, p2, p3.

In[1]:=
Module[
   {gf = .35*z^2500 + .35*z^5000 +.15*z^7500 + .15*z^10000},
   .4 + .35*gf + .15*gf^2 +.1*gf^3 // Expand //
     Replace[List @@ #,
       {k_.*z^p_. -> {p, k}, k_ -> {0, k}},
       {1}]&
]

Out[1]=
{{0, 0.4}, {2500, 0.1225}, {5000, 0.140875}, {7500, 0.0935375}, {10000,  
0.0994875}, {12500, 0.049875}, {15000, 0.03995}, {17500, 0.02565}, {20000,  
0.015975}, {22500, 0.007425}, {25000, 0.003375}, {27500, 0.0010125},  
{30000, 0.0003375}}

Here's how we can apply Fourier to this problem:

In[2]:=
F = Fourier;
IF = InverseFourier;
SetOptions[#, FourierParameters -> {1, 1}]& /@ {F, IF};

Module[{L},
   L = PadRight[{0., .35, .35, .15, .15}, 13];
   IF[.4*F[L]^0 + .35*F[L]^1 + .15*F[L]^2 + .1*F[L]^3] // Chop
]

Out[5]=
{0.4, 0.1225, 0.140875, 0.0935375, 0.0994875, 0.049875, 0.03995, 0.02565,  
0.015975, 0.007425, 0.003375, 0.0010125, 0.0003375}

With the default setting of FourierParameters

F[Convolution[f, g]] == Sqrt[Length[f]]*F[f]*F[g].

Maxim Rytin
m.r at inbox.ru


  • Prev by Date: Re: [Mathematica 5.1] Bug Report - Two numerical values for a same variable
  • Next by Date: Re: finding package in ExtraPackages`Enhancements`
  • Previous by thread: Re: Fourier Transfer and a game?!?!
  • Next by thread: Re: Re: Fourier Transfer and a game?!?!