# Thread: Prob. of falling into a certain interval

1. ## Prob. of falling into a certain interval

Sorry about the poor title. Here are my problems:

1. Divide [0,1] into k intervals of equal size, and generate n observations from a uniform distribution. The number X_i of these n observations which fall into the i:th interval is a random variable. What is the distribution of X_i?

2. Consider instead the proportion (Y_i = X_i/n) of observations falling into the i:th interval; this is also a random variable. Determine expected value, variance and std.dev for Y_i.

I really have no idea on either of these. On the first one I want to say that X_i is uniformly distributed; my reasoning is that the observations will be distributed according to a uniform distribution, so the number of observations falling into the i:th interval should be uniformly distributed as well. A Matlab exercise associated with this seems to imply that X_i is indeed uniformly distributed, but is it really this simple?

I don't know about the second one either, i.e. what the distribution of Y_i is. I can determine expected value etc if I know the density function so that's not the primary issue here. But, supposing for a moment that X_i is uniformly distributed, U(a,b), with density function 1/(b-a); what would the density function Y_i := X_i/n be?

(Note: The questions are translated from Swedish, I don't know if there are any "false twins" which might mean different things in English.)

2. ## Re: Prob. of falling into a certain interval

Hey spudwish.

The first thing you need to do is to get a computer program to generate some numbers. A program like R will work with the runif() command.

Then you need to check whether the number is in a certain interval and increase the count of that particular cell.

Have you used R?

3. ## Re: Prob. of falling into a certain interval

I have used R some, but these questions are part of a Matlab simulation. Like I mentioned, if I do simulations it seems X_i is uniformly distributed, but I can't convince myself of this, i.e. what's the theory?