Re: Strange Probability function behavior (Bug?)
- To: mathgroup at smc.vnet.net
- Subject: [mg122910] Re: Strange Probability function behavior (Bug?)
- From: Darren Glosemeyer <darreng at wolfram.com>
- Date: Wed, 16 Nov 2011 04:43:53 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <201111141207.HAA11675@smc.vnet.net> <201111151050.FAA23772@smc.vnet.net>
On 11/15/2011 4:50 AM, Brentt wrote: > Oh wait, never mind, it works now that I've restarted the program. Not sure > what happened. But its fine now. > > On Mon, Nov 14, 2011 at 5:43 AM, Bob Hanlon<hanlonr357 at gmail.com> wrote: > >> Works here. Probability is new in version 8. Are you using version 8? >> >> $Version >> >> "8.0 for Mac OS X x86 (64-bit) (October 5, 2011)" >> >> Probability[x == 3, Distributed[x, PoissonDistribution[m]]] >> >> ((1/6)*m^3)/E^m >> >> >> Bob Hanlon >> >> >> On Mon, Nov 14, 2011 at 7:07 AM, Brentt<brenttnewman at gmail.com> wrote: >>> Hello, >>> >>> If I go to the Probability function documentation, and evaluate a >>> probability function in the documentation notebook, the probability >>> function works as would be expected, for example: >>> >>> In[0]:= Probability[x == 3, Distributed[x, PoissonDistribution[m]]] >>>> Out[0]= 1/6 E^-m m^3 >>>> >>> So far so good. >>> >>> But strangely, if I open up a new notebook and copy and paste the exact >>> expression from above into it, I get this >>> >>> In[0]:= Probability[x == 3, Distributed[x, PoissonDistribution[m]]] >>>> Out[0]:= Probability[True, 3 \[Distributed] PoissonDistribution[m]] >>>> >>> What could possibly be happening here? Is this a bug? >>> What you saw originally would happen if x had been assigned the value of 3 earlier in the session. In[1]:= x = 3; In[2]:= Probability[x == 3, Distributed[x, PoissonDistribution[m]]] Out[2]= Probability[True, 3 \[Distributed] PoissonDistribution[m]] One way this could easily happen (aside from a direct assignment like above) is if you had accidentally evaluated with a single = sign, e.g. Probability[x = 3, Distributed[x, PoissonDistribution[m]]] then corrected the syntax and re-evaluated. Darren Glosemeyer Wolfram Research
- References:
- Strange Probability function behavior (Bug?)
- From: Brentt <brenttnewman@gmail.com>
- Re: Strange Probability function behavior (Bug?)
- From: Brentt <brenttnewman@gmail.com>
- Strange Probability function behavior (Bug?)