1
$\begingroup$

I am trying to find the probability of one discrete random variable, $i$, being greater than discrete random variable, $j$.

The probability of $j$ taking a particular integer value $\{-c, -c + 2, \text{...} , c - 2, c\}$, given $t_1$, and $p$, where $t_1$ is one of the possible integers $\{-c, -c + 2, \text{...} , c - 2, c\}$, and where $0\leq p\leq 1$, is given by:

\[Alpha][j_] := Sum[Binomial[(1/2)*(c + Subscript[t, 1]), k]*
   p^(2*k - (1/2)*(i + Subscript[t, 1]))*
   Binomial[(1/2)*(c - Subscript[t, 1]), (c + i)/2 - k]*
   (1 - p)^(c - (2*k - (1/2)*(i + Subscript[t, 1]))), 
 {k, Max[0, (1/2)*(i + Subscript[t, 1])], 
   Min[(c + i)/2, (1/2)*(c + Subscript[t, 1])]}]

while the probability of $i$ taking a particular integer value $\{-c, -c + 2, \text{...} , c - 2, c\}$, given $t_2$, and $p$, where $t_2$ is one of the possible integers $\{-c, -c + 2, \text{...} , c - 2, c\}$, is given by:

\[Beta][i_] := Sum[Binomial[(1/2)*(c + Subscript[t, 2]), k]*
   p^(2*k - (1/2)*(i + Subscript[t, 2]))*
   Binomial[(1/2)*(c - Subscript[t, 2]), (c + i)/2 - k]*
   (1 - p)^(c - (2*k - (1/2)*(i + Subscript[t, 2]))), 
 {k, Max[0, (1/2)*(i + Subscript[t, 2])], 
   Min[(c + i)/2, (1/2)*(c + Subscript[t, 2])]}]

My approach to solving this problem is shown below. My problem is that I can't seem to formulate the final expression using Mathematica. Or, perhaps my problem is deeper yet. In any case, I am looking for help using Mathematica on this problem:enter image description here

Sum[\[Beta][i_]*\[Alpha][j_], {i, c, -c + 2}, {j, i - c, -c}], in steps of -2
$\endgroup$
2
  • $\begingroup$ Functions should be input as Wolfram Language code, not LaTeX. Edit your question, copy and paste in the code, select the block of code, then use the {} button to format the code. Also, post code, not pictures of code. $\endgroup$
    – Edmund
    Commented Nov 8, 2017 at 21:57
  • $\begingroup$ Edmund, I hope this suffices? $\endgroup$
    – user120911
    Commented Nov 8, 2017 at 22:09

1 Answer 1

3
$\begingroup$

You may use WeightedData to construct an EmpiricalDistribution and then frame your problem as an inequality using Probability.

First realise that you only need define on probability mass function. This can be done by using parameters instead of relying on global variables. Use your α definition:

pmf[c_, t_, p_, x_] := 
 Sum[Binomial[(c + t)/2, k] p^(2 k - (x + t)/2 ) 
     Binomial[(c - t)/2, (c + x)/2 - k] 
     (1 - p)^(c - (2 k - (x + t)/2)), 
   {k, Max[0, (x + t)/2], Min[(c + x)/2, (c + t)/2]}] 

The PMF looks good; sums to 1 and positive over the domain.

With[{c = 5},
 Sum[pmf[c, -3, .5, x], {x, -c, c, 2}]
 ]
1.
With[{c = 5},
 DiscretePlot[pmf[c, -3, .5, x], {x, -c, c, 2}]
 ]

Mathematica graphics

The PMF can be used to create an EmpiricalDistribution. Create a distribution for i and j. I used c = 5 and p = .5 for both with t1 = -3 and t2 = -1.

With[{c = 5},
 iDist = EmpiricalDistribution@WeightedData[Range[-c, c, 2], pmf[c, -3, .5, #] &];
 jDist = EmpiricalDistribution@WeightedData[Range[-c, c, 2], pmf[c, -1, .5, #] &];
 ]

Next use Probability to evaluate your result.

Probability[i > j, {i \[Distributed] iDist, j \[Distributed] jDist}]
0.376953

I also tried using ProbabilityDistribution on the PMF but it would not cooperate so went for EmpiricalDistribution. The ProbabilityDistribution approach would allow for symbolic evaluation and I have gone out to WRI to find out why this PMF does not cooperate. Perhaps the above is all you need.

Hope this helps.

$\endgroup$
4
  • $\begingroup$ Thank you very much for your instructive answer, Edmund. This certainly helps me a lot. Of course, it would have been ideal if ProbabilityDistribution worked here. What, by the way is WRI? $\endgroup$
    – user120911
    Commented Nov 10, 2017 at 18:24
  • $\begingroup$ @user120911 WRI = Wolfram Research Inc. $\endgroup$
    – Edmund
    Commented Nov 10, 2017 at 19:17
  • $\begingroup$ thank you. That is much appreciated. I would be very interested to hear what they say about this problem. $\endgroup$
    – user120911
    Commented Nov 10, 2017 at 19:26
  • $\begingroup$ Did you ever hear from WRI about why Mathematica had trouble with the PMF? $\endgroup$
    – user120911
    Commented Feb 12, 2018 at 8:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.