Skip to main content
14 events
when toggle format what by license comment
S Oct 23, 2014 at 2:14 history suggested A.G. CC BY-SA 3.0
Second condition should be (...) < 3/2 as per OP's comment.
Oct 23, 2014 at 2:14 vote accept Wyvern666
Oct 23, 2014 at 2:09 answer added Andy Ross timeline score: 5
Oct 23, 2014 at 2:01 history tweeted twitter.com/#!/StackMma/status/525104676279050240
Oct 23, 2014 at 1:47 review Suggested edits
S Oct 23, 2014 at 2:14
Oct 23, 2014 at 1:38 answer added A.G. timeline score: 3
Oct 23, 2014 at 1:18 comment added Nasser Just use Plot. I just typed DiscretePlot cause I was looking at example. Once you have Distribution, you can use Mean on it. As in Mean[D0] gives 3/4 There is also expectation, reference.wolfram.com/language/ref/Expectation.html
Oct 23, 2014 at 1:07 comment added Wyvern666 @Nasser It is supposed to be the pdf of a continous random variable, why the discrete plot?. The thing is how to pass that to ExpectedValue[]?
Oct 23, 2014 at 1:03 comment added Nasser hum.. Should not your function be Piecewise[{{1, 0 < x < 1/2 || 1 < x < 3/2}, {0, True}}] ? Otherwise, looks ok. Try it, like this D0 = ProbabilityDistribution[Piecewise[{ {1, 0 < x < 1/2 || 1 < x < 3/2}, {0, True}}], {x, -Infinity, Infinity}]; then you can plot it. DiscretePlot[Evaluate[CDF[D0, x], {x, -10, 10}]], etc... see help for more information.
Oct 23, 2014 at 0:52 comment added Wyvern666 @Nasser This is ok?: ProbabilityDistribution[ Piecewise[{{1, 0 < x < 1/2 || 1 < x < 3/2}, {0, false}}], {x, -Infinity, Infinity}]
Oct 23, 2014 at 0:46 comment added Nasser This is a function definition. Not PDF. Check how to define own PDF here reference.wolfram.com/language/ref/ProbabilityDistribution.html
Oct 23, 2014 at 0:43 comment added Wyvern666 @belisarius Yes, like this: Piecewise[{{1, 0 < x < 1/2 || 1 < x < 3/2}, {0, false}}]. The problem is that i dont know how to pass that to ExpectedValue[]
Oct 23, 2014 at 0:37 comment added Dr. belisarius First ...How to write that PDF in Mathematica? Have you tried?
Oct 23, 2014 at 0:32 history asked Wyvern666 CC BY-SA 3.0