Guest User

Code forhttp://math.stackexchange.com/questions/1243365

a guest
Apr 20th, 2015
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. dist = EmpiricalDistribution[Array[pr, 3^2] -> Tuples[Range[3], 2]];
  2.  
  3. {inst} = FindInstance[
  4. sol = Reduce[
  5. ForAll[x,
  6. CDF[MarginalDistribution[dist, 1], x] ==
  7. CDF[MarginalDistribution[dist, 2], x]] &&
  8. DistributionParameterAssumptions[dist] &&
  9. Array[0 <= pr[#] <= 1 &, 3^2, 1, And] &&
  10. Expectation[x/(x + y), {x, y} \[Distributed] dist] !=
  11. Expectation[y/(x + y), {x, y} \[Distributed] dist], Reals],
  12. Array[pr, 3^2]]
  13.  
  14. PiecewiseExpand[PDF[counterExampleDist = dist /. inst, {x, y}]]
  15.  
  16. {CDF[MarginalDistribution[counterExampleDist, 1], x],
  17. CDF[MarginalDistribution[counterExampleDist, 2], x]}
  18.  
  19. {Expectation[x/(x + y), {x, y} \[Distributed] counterExampleDist],
  20. Expectation[y/(x + y), {x, y} \[Distributed] counterExampleDist]}
  21.  
  22. DiscretePlot3D[
  23. PDF[counterExampleDist = dist /. inst, {x, y}], {x, 1, 3}, {y, 1, 3},
  24. ExtentSize -> 0.9, PlotTheme -> "Web"]
Add Comment
Please, Sign In to add comment