1

If I multiply two random numbers from 1 to 10 together I will get an outcome from 1 to 100. Over a large enough sample size the outcomes will tend to cluster closer to 1 than to 100 (only 21 of the 100 possible outcomes are greater than 50, for example).

  • How would the probability distribution of the outcomes be described?

  • Suppose that I have a percentage figure, say 60% in mind; how would I find the number below which I could expect 60% of all outcomes to fall? (For example - 79% of all outcomes fall below 50).

Please keep in mind that I am looking for a solution that is easily programmable (ie not reliant on graphs or tables etc).

2 Answers2

2

How would the probability distribution of the outcomes be described?

You would describe it precisely using a probability mass function. This simply lists the probabilities of each outcome individually:

$$\begin{eqnarray*} \rm{Pr}(X=1) &=& 0.01 \\ \rm{Pr}(X=2) &=& 0.02 \\ \rm{Pr}(X=3) &=& 0.02 \\ \rm{Pr}(X=4) &=& 0.03 \\ \ldots && \\ \rm{Pr}(X=100) &=& 0.01 \end{eqnarray*}$$

The sum of all the probabilities has to add up to one, of course.

$$\sum_{x=1}^{100}\rm{Pr}(X=x) = 1$$

Descriptive statistics can also be used. E.g. a graphical description using a histogram, left, or a boxplot, right.

enter image description here

Or, you can quantitatively summarize the distribution. The median is 24, the mean is 30.25, the standard deviation (a measure of spread) is 23.94. The statistical term used for "Over a large enough sample size the outcomes will tend to cluster closer to 1 than to 100" is that the distribution is right-skewed, or colloquially, has a right tail (this can be expressed quantitatively using skew).

Suppose that I have a percentage figure, say 60% in mind; how would I find the number below which I could expect 60% of all outcomes to fall? (For example - 79% of all outcomes fall below 50).

Mathematically, what you are doing here is using the quantile function, $Q$. This is the inverse of the cumulative distribution function $F$, which is defined as follows:

$$F(x) = \rm{Pr}(X\le x)$$

So, $Q = F^{-1}$, e.g. to find the median $m$, we solve $\rm{Pr}(X\le m) = 0.5$.

Please keep in mind that I am looking for a solution that is easily programmable (ie not reliant on graphs or tables etc).

For this particular problem, I would say the easiest solution is to list all the possible outcomes ($1\times 1, 1\times 2, 1\times 3 \ldots 10\times 10$), and sort the list. Then the $n^{\rm{th}}$ value in the list gives $\rm{Pr}(X\le n/100)$, because all outcomes are equally likely. In a language such as C, C++ or Java you could write a nested for loop to write the outcomes into an array and then use built-in functions to sort the array.

In a language like R, you can make use of built-in vector operations like so. The R code below confirms your assertion that "79% of all outcomes fall below 50".

> x=sort(outer(1:10,1:10))
> x[79]
[1] 49
> x[80]
[1] 50
TooTone
  • 6,343
0

I suppose you mean the random variables to be independent. Then you should simply program a simulation. As an example, following yours, suppose ¤X¤ and ¤Y¤ are two independent random variables, each with a uniform distribution on $\{1,2,3,4,5,6,7,8,9,10\}$. The do this in R:

repl <- 100000
X <- sample(1:10, repl, replace=TRUE)
Y <- sample(1:10, repl, replace=TRUE)
Z <- X*Y
hist(Z)

or you can do any other calculations you want with your sample $Z$ to describe its distribution.

  • rather than simulating, it is easier to get the actual distribution in this case. E.g., run par(mfrow=c(1,2)); hist(Z,breaks=seq(0,100,by=2.5)); x=sort(outer(1:10,1:10)); hist(x,breaks=seq(0,100,by=2.5)). – TooTone Jul 31 '13 at 15:12