Give an efficient algorithm to simulate the value of a random variable with probability mass function

p1 = .15 p2 = .2 p3 = .35 p4 = .30

Short Answer

Expert verified

The algorithm is define Xusing the Uniform continuous distribution Uover (0,1).

Step by step solution

01

Given Information

We have given the probability mass function

p1=.15p2=.2p3=.35p4=.30

02

Simplify

Generating U~Unif(0,1).

Now, declare Xas follows

X=1,U0,0.152,U0.15,0.353,U0.35,0.74,U0.7,1

Consider that because of the construction we have, for example

P(X-1)=P(U(0,0.15))=0.15=p1

and similarly for all other values

P(X=i)=pi

So, we haveXfollows the required discrete distribution.

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Study anywhere. Anytime. Across all devices.

Sign-up for free