# Tag Info

## Hot answers tagged probability-or-statistics

### How can I define a distribution and get the expectation in Mathematica?

There are many ways. Here's one: dist = TransformedDistribution[x aH + (1 - x) aL, x \[Distributed] BernoulliDistribution[λ]] Mean[dist] (* aL+aH λ-aL λ *)
• 34.1k

### How can I define a distribution and get the expectation in Mathematica?

As JimB notes, there are many ways. Here's another: ...
• 1,397
Accepted

### How can I efficiently calculate exact probability distributions for D&D dice like "4d8"?

Based on eyorble's comment here's how to do it with generating functions. The main idea: with some probability distribution $p_n: P(X=n)=p_n$ you can associate a polynomial called the generating ...

### How can I efficiently calculate exact probability distributions for D&D dice like "4d8"?

Implementing @eyorble's idea in the comments: problist[n_, d_] := Rest[CoefficientList[(1/d Sum[x^i, {i, 1, d}])^n, x]] This returns a list of length $nd$ ...
• 13.6k

### How can I efficiently calculate exact probability distributions for D&D dice like "4d8"?

Define two helper functions. One for the generator function of NdS expressed as a polynomial in terms of $x$: dg[x_, n_, s_] := (x (x^s - 1)/(x - 1))^n; And ...
• 8,523

### Choosing The Best Fitted Probability Distribution Model

Using AIC you can rank the goodness-of-fit for each probability distribution but that doesn't mean any of the fits are good or bad. Just a relative ranking. But you don't want to use regression (i.e.,...
• 34.1k

### PDF of double truncated exponential function

You can obtain it as follows: ...
• 60.1k