How many gigabytes of data a person uses per month rounded


FUNCTION OF A RANDOM VARIABLES

Problem Description

A cell-phone carrier offers the following monthly options:

  • Base fee of $20 (no data);
  • $7for the first 10 Gbytes of data;
  • An extra $19 for the next 10 GBytes of data use, i.e. you pay $46 if you exceed 10 Gbytes, but do not get to 20 Gbytes;
  • $15 extra for the next 10 GBytes;
  • $11 extra for the next 10 GBytes;
  • $7 extra for the next 10 GBytes;
  • $3 extra for the next 10 GBytes (we are in the 50-60 Gbyte range);
  • When you exceed 60 Gbytes of data use, you get charged a flat fee of $100 (including the base fee) until you get to 100 Gbytes.
  • You may not exceed 100 Gbytes, i.e. at this point your service is stopped until the following month.

Assume X is a random variable that represents how many Gigabytes of data a person uses per month, rounded up to the nearest multiple of 10 Gbytes. The units of X are 10 GBytes, e.g. X = 3 means the person used more than 20, but less than 30 Gbytes.

Note: The range of X is, then, SX = {0, 1, 2,..., 10}.

Assume random variable Y represents how much a person pays per month for using this carrier's service. X=0 implies the client is only paying for the base fee, without any data plan.

a. Using Matlab'spolyfit(), find a function Y = g(X) for the amount, in dollars, for each of the plans. This function should be expressed as follows:

              {                     a,   0
Y=g(X)= { (aX2 + cX + d,   X = 1,2,3,4,5,6
              {                     e,   X = 7,8,9,10

In this function, Xis an integer between 0 and 10, and it specifies now many 10s of Gigabytes a person is choosein and it specifies the number of pounds with rounding up for a fraction.

Hint: Should you use ever value of X when invoking polyfit()?

Find the range of Y, SY, and plot it vs. the range of X.

b. Assume customers are equally likely to use the first four plans, i.e. the plan with no data and the 10, 20, and 30 Gbyte plans. The plans with 40, 50, and 60 GByte are one third as likely as the first four. The 100 Gbyte plan is one fourth as likely as the 10 GByteplan. Assume the customers choice is given by random variable X. Derive the PMF and calculate the expected value and variance of X.Make a plot of the PMF of X, and include the expected value and the variance in the title, using the figure at the top of the next page as an example. Note: The figure does not correspond to the PMF of X described in this handout.

704_Function.jpg

Note 1: The line function can be used to generate a vertical line.
Note 2: Explore the LineWidth property in the plot function. It is useful for changing the width of the curves in your graphs, and can be tweaked to make a plot more readable (i.e. prettier!).

c. Using the function derived in part a), derive by hand the PMF of random variable Y (i.e., the random variable that is equal to the amount of money a customer will pay given a specific plan), and calculate the expected value of Y and the variance of Y. You should calculate the expected value via two methods:

E[Y] = ∑y.P[Y=y] (summing over the range of Y)
E[Y] = ∑g(X).P[X=x] (summing over the range of X)
Both methods should result in the same answer.

d. Write a Matlab function, say find_pmf_Y(), that will take as arguments the following:
The range of X, SX.
The range of Y, SY.
The PMF of X.
The function should return the PMF of Y, and should be identical to what you derived in part c). Invoke the function to get the PMF of Y.

e. Write a Matlab function say, exp_val_Y(), that will take four arguments:
The range of Y, SY.
The PMF of X.
The PMF of Y.
Function g(X) = Y.
The function should return the expected value of Y using the two same methods used in part c.

f. Plot the PMF of Y, using the graph at the top of this page as an example.

g. Generate a random vector of N = 100,000 customers, say x_vec, that corresponds to PX(x), described in part b). This means that, for example, customers that use the 10 Gb plan should be twice as likely to occur than those that use the 50 Gb plan, and four times as likely as the 100 Gb plan users. Plot the normalized histogram of vector x_vec. If should approximate the PMF plotted in part b). At the title of the histogram plot, indicate the sample mean of the vector x_vec,μX.

h. Generate a random vector, say y_vec, that corresponds to every value in vector x_vec. Calculate the sample mean, μY, using vector y_vec. Plot the histogram of the random vector, and indicate the sample mean in the title. This histogram should approximate the PMF you plotted in part f). What is the meaning of the μY?

Note: Starting in part b), your Matlab functions should not be specific to the g(X) you derived in part a). When you turn in your code, I will run it with a different values for PX(x), SX, and SY. The reason for this is to tests various sample plans. For example, will the plan given in the problem description yield more gains for a different PMF for X? Or, say we keep the same PMF for X, will a slight alteration of the plan result in better earnings?

Thus, in your code (at least parts b) onwards), it should be easy to modify the PMF of X and the function Y=g(X).

Deliverables:
You should turn in the following:
Formal lab report (printed).
All matlab code with clear and specific instructions as to how to modify your code so that I can test arbitrary values for the PMF of X and for Y = g(X). To make it more manageable, let's assume that the range of X will never change, i.e. SX = {0, 1, 2,..., 10}.

Solution Preview :

Prepared by a verified Expert
MATLAB Programming: How many gigabytes of data a person uses per month rounded
Reference No:- TGS02658038

Now Priced at $70 (50% Discount)

Recommended (96%)

Rated (4.8/5)