In: Statistics and Probability
Write a program to choose a random number X in the interval [2,10] 1000 times and record what fraction of the outcomes satisfy X > 5, what fraction satisfy 5 < X < 7, and what fraction satisfy x2 −12x+35 > 0. How do these results compare with Exercise 1?
Since 
is chosen randomly from
the interval, no area of the interval is more likely to be drawn
from than any other. The density function for the outcome of
 is
uniform (constant).
The cumulative distribution function, 
, is:
where 
  
where 
  where   
The probability density function, 
, is the
derivative of the cumulative distribution function:
  
 where
  
  
 where
  
  
   where
  
And the probability of some event 
 occurring where
 is a
sub interval 
 of
 is

For,


For,

  
And For,

  




Thus, the program is
Experimental results from drawing a random real number from
 times:


