Uniform distribution & expected payment for internet-service contract

Amazon1234

New member
Joined
Oct 17, 2018
Messages
7
Hi,

what is the cheapest option between these 2 internet contracts?

- Pay $3 base fee if consume from 0Go to 3Go internet, then $4 extra per 1Go consumed from 3 to 10 Go.
- Pay $9 base fee to consume up to 9Go, then pay $4 extra if consume between 9 and 10 Go.

The probability of consuming data is uniformally distributed over the interval 0-10 Go. What is the expected payment for each contract?
 
Hi,

what is the cheapest option between these 2 internet contracts?

- Pay $3 base fee if consume from 0Go to 3Go internet, then $4 extra per 1Go consumed from 3 to 10 Go.
- Pay $9 base fee to consume up to 9Go, then pay $4 extra if consume between 9 and 10 Go.

The probability of consuming data is uniformally distributed over the interval 0-10 Go. What is the expected payment for each contract?

X is a random variable that is your data usage in a month in GB (or Go, whatever the **** those are. I'll use GB). X is uniformly distributed between 0 GB and 10 GB. In other words, X's probability density function (pdf) is given by:

\(\displaystyle \displaystyle f_X(x) = \left\{ \begin{array}{ll} \frac{1}{10},~~ 0 \leq x \leq 10\\0,~~\mathrm{otherwise} \end{array} \right. \)

I'll give you that one as a freebie. Now we have another random variable P that is the amount you pay for your internet usage in any given month. This random variable is a function of the random variable X: P(X). Can you write down expressions for P(X) for each of the two internet plans? I'm not going to give you this one as a freebie, because then I'd be solving the problem for you, and you would learn zero probability theory/statistics.

Since you have the pdf, you know how to compute the expected value of your data usage, \(\displaystyle E[X]\). But how do you compute the expected value of a function of a random variable, \(\displaystyle E[P(X)]\)?

Hint: https://en.wikipedia.org/wiki/Law_of_the_unconscious_statistician
 
Thank you so much for your help!
IMG_6352.jpg

Here is what I have done for the 1st internet plan (3BG for $3, then pay $4/ extra GB). I'm marking a mistake somewhere because I have checked the results using the Excel "brute force": the result should be $14.2. Would you be able to tell me where I'm wrong? Thanks!
 
Hi Amazon1234,

Remember that this random variable is not discrete, it's continuous. Because you aren't limited to just using an integer number of gigabytes. E.g. For the first plan, any value in excess of 3 GB gets charged at the rate of $4 per GB. Presumably, if you used 3.1 GB total, you'd be charged $3 + ($4/GB * 0.1 GB) = $3 + $0.40 = $3.40.

Therefore, your second integral shouldn't range from 4 to 10. It should range from 3 to 10.
 
Also, for the first Internet plan, I actually get $12.80 as the expected payment using three methods:

1) pencil and paper calculation
2) Sticking the definite integrals into Wolfram Alpha
3) Writing a few lines of Python to simulate this 1 million times using the function numpy.random.uniform

It seems like your Excel "brute force" method might not be correct. How exactly did you do this?
 
$4 increment is discrete

Hi Amazon1234,

Remember that this random variable is not discrete, it's continuous. Because you aren't limited to just using an integer number of gigabytes. E.g. For the first plan, any value in excess of 3 GB gets charged at the rate of $4 per GB. Presumably, if you used 3.1 GB total, you'd be charged $3 + ($4/GB * 0.1 GB) = $3 + $0.40 = $3.40.

Therefore, your second integral shouldn't range from 4 to 10. It should range from 3 to 10.

Actually, the $4 increment is discrete. You are paying $4 as long as data consumption X: 3<X<=4 GB. Can you help me to solve the problem?
 
Also, for the first Internet plan, I actually get $12.80 as the expected payment using three methods:

1) pencil and paper calculation
2) Sticking the definite integrals into Wolfram Alpha
3) Writing a few lines of Python to simulate this 1 million times using the function numpy.random.uniform

It seems like your Excel "brute force" method might not be correct. How exactly did you do this?

Plan 11234567
X Data Usage12345678910
Probability0.10.10.10.10.10.10.10.10.10.1
Payment depending on X3337111519232731
Payment * Probability0.30.30.30.71.11.51.92.32.73.1
Expected Payment14.2
Plan 21
X Data Usage12345678910
Probability0.10.10.10.10.10.10.10.10.10.1
Payment depending on X99999999913
Payment * Probability0.90.90.90.90.90.90.90.90.91.3
Expected Payment9.4

Did I make a mistake?
 
Excel brute force method

Plan 11234567
X Data Usage12345678910
Probability0.10.10.10.10.10.10.10.10.10.1
Payment depending on X3337111519232731
Payment * Probability0.30.30.30.71.11.51.92.32.73.1
Expected Payment14.2
Plan 21
X Data Usage12345678910
Probability0.10.10.10.10.10.10.10.10.10.1
Payment depending on X99999999913
Payment * Probability0.90.90.90.90.90.90.90.90.91.3
Expected Payment9.4


Anything wrong there?
 
New attempt

Is that the right way now? Is the figure for the $9 plan correct? Thanks!IMG_6383.jpg
 
Actually, the $4 increment is discrete. You are paying $4 as long as data consumption X: 3<X<=4 GB. Can you help me to solve the problem?

No. This doesn't make sense. Nothing is discrete here. What if your usage had been BETWEEN 3 GB and 4 GB? You'd be in the regime where you were paying $3 + $4/GB. That interval still has to be in your integral over the probability density function.
 
Plan 11234567
X Data Usage12345678910
Probability0.10.10.10.10.10.10.10.10.10.1
Payment depending on X3337111519232731
Payment * Probability0.30.30.30.71.11.51.92.32.73.1
Expected Payment14.2
Plan 21
X Data Usage12345678910
Probability0.10.10.10.10.10.10.10.10.10.1
Payment depending on X99999999913
Payment * Probability0.90.90.90.90.90.90.90.90.91.3
Expected Payment9.4


Anything wrong there?


Yes, something is dramatically wrong, unfortunately. You're treating the random variable X as though it were discrete, i.e. it could only take on integer values between 1 and 10 GB. That's not correct. Your data usage could easily be 3.426 GB or 7.37404 GB or...it can take on a whole continuum of values (any real number between 1 and 10). That's why this Excel brute force method doesn't work.

Your spreadsheet is using the summation of discrete values:

\(\displaystyle \displaystyle E[P(X)] = \sum_{x=1}^{10} P(x)f(x) \)

where \(\displaystyle f(x)\) is the discrete probability mass function (pmf)

What you should be doing is computing it using the integral over a continuous range

\(\displaystyle \displaystyle E[P(X)] = \int_0^{10} P(x)f(x)dx \)

where \(\displaystyle f(x)\) is the continuous probability density function (pdf)
 
Last edited:
Is that the right way now? Is the figure for the $9 plan correct? Thanks!View attachment 10382


This seems right to me: https://www.wolframalpha.com/input/...+integral+from+9+to+10+of+9/10++4*(x-9)/10+dx

With the following CAVEAT :

Hi,

what is the cheapest option between these 2 internet contracts?

- Pay $3 base fee if consume from 0Go to 3Go internet, then $4 extra per 1Go consumed from 3 to 10 Go.
- Pay $9 base fee to consume up to 9Go, then pay $4 extra if consume between 9 and 10 Go.

The probability of consuming data is uniformally distributed over the interval 0-10 Go. What is the expected payment for each contract?

Unlike with the $3 plan, the part in boldface doesn't say "$4 per 1 GB". If it's just a straight $4 extra regardless of the extra amount, then the answer would be different.
 
No. This doesn't make sense. Nothing is discrete here. What if your usage had been BETWEEN 3 GB and 4 GB? You'd be in the regime where you were paying $3 + $4/GB. That interval still has to be in your integral over the probability density function.

Which post are you referring to (my post did not go through for a while and suddenly all appeared...)? Cam you let me know if the following is right (enclosed). Thanks!IMG_6383.jpg
 
Which post are you referring to (my post did not go through for a while and suddenly all appeared...)? Cam you let me know if the following is right (enclosed). Thanks!View attachment 10398

Could you just read a bit more carefully please? I always quoted which post I was referring to. I already replied telling you that I thought 9.2 was correct, and linking to a Wolfram Alpha computation of the integral. There are multiple replies from me above.
 
Top