# Finding average from uniformly distributed values

Let's say, I am sending network packets at the rate of 450 packets per second.

The size of these packets is uniformly distributed between 100 to 500 bytes.

I want to know what's the average packet size / per second?

I tried to solve it:

Since its uniformly distributed, so the average of size is (100 + 500)/2 = 300.

So, the answer is simply 300 bytes?

• I was surprised to find that the expected (=average) number of rolls of a $6$-sided die for rolling a certain value (say, 3 poins) at once is $6$. So yes, it's that simple. Commented Jun 1, 2020 at 0:59

Let's add a bit of formalism here. Let $$X$$ (a random variable) be the size of the packet. We know that $$X \text{~} \text{Unif}(100,500)$$. Thus the expected size of a packet is $$\mathrm{E}(X)=\int_{100}^{500} {\frac{1}{500-100}x}\mathrm{d}x=300.$$ Then, the time it takes to send the average packet is $$\frac{300 \text{ bytes}}{450 \text{ bytes per second}}=2/3 \text{ second}$$