Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #6463

Re: Strange Probability function behavior (Bug?)

From Darren Glosemeyer <darreng@wolfram.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Strange Probability function behavior (Bug?)
Date 2011-11-16 09:45 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <ja00n3$603$1@smc.vnet.net> (permalink)
References <201111141207.HAA11675@smc.vnet.net> <201111151050.FAA23772@smc.vnet.net>

Show all headers | View raw


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@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@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

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: Strange Probability function behavior (Bug?) Darren Glosemeyer <darreng@wolfram.com> - 2011-11-16 09:45 +0000

csiph-web