Group Abstract Group Abstract

Message Boards Message Boards

0
|
492 Views
|
2 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Induced probability distribution of arbitrary functions

I am not currently a user of Mathematica, I am trying to figure out if it can do what I need first. As the title says, I'm interested in induced probability distributions. That is, given we choose a probability distribution for the input space to a function, what is the induced probability distribution of that function?
I'm interested in answering this question for a range of functions, from something as elementary as basic arithmetic operations to, let's say, Euclid's algorithm for GCD.
So another way of asking this question is, how much of that paper by Diaconis and Erdos can Mathematica do by itself?
https://apps.dtic.mil/sti/tr/pdf/ADA048791.pdf
Thanks.

POSTED BY: Jeremy Murphy
2 Replies
Posted 1 month ago

Gianluca's suggestion is many times what you want. In this case a little work finds a general formula for the first part of the paper.

The paper deals with asymptotic properties of some statistics but for Mathematica easily finds the exact distribution, mean, and variance. (Approximately) using the notation in the paper two random variables N and M are selected from a discrete uniform distribution of the integers 1 through x. The probability mass function (pmf) for x=6 is given by the following:

x = 6;
pmfCounts = Tally[Flatten[Table[GCD[m, n], {n, 1, x}, {m, 1, x}], 1]]
(* {{1, 23}, {2, 7}, {3, 3}, {4, 1}, {5, 1}, {6, 1}} *)
pmf = pmfCounts;
pmf[[All, 2]] = pmf[[All, 2]]/x^2;
pmf
(* {{1, 23/36}, {2, 7/36}, {3, 1/12}, {4, 1/36}, {5, 1/36}, {6, 1/36}} *)

Then we check the frequency counts at oeis.org and find sequence A242114. The general Mathematica formula for the pmf is

gcdpmf[n_, k_] := (2  Total[EulerPhi[Range[Quotient[n, k]]]] - 1)/n^2
gcdpmf[213,47]
(* 11/45369 *)

From there you can calculate means, variances, etc. If you are more interested in asymptotic properties of functions of random variables, then specific examples are helpful.

POSTED BY: Jim Baldwin

I am not sure, but you may check out TransformedDistribution: http://reference.wolfram.com/language/ref/TransformedDistribution.html

POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard