Question

Write code that when you are given the range and probability distribution of a random variable...

Write code that when you are given the range and probability distribution of a random variable X. (i.e X ="the number of heads showing on 2 flipped fair coins":

range = (0,1,2)

probability distribution: [.25, .5, .25]

Such that the code returns the expected value, standard deviation, and variance of the random variable . thanks!

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution :

expected value = \sum X * P(X)

= 0 *0.25 + 1 * 0.5 + 2 *0.25  

= ( 0+ 0.5 + 0.5 )

= 1

Standard deviation = \sigma

==\sqrt\sumX 2 * P(X) - \mu 2

=  \sqrt[ 02   * 0.25+ 12   *0.5 + 22 *0.25 ] - (1)2

= \sqrt [( + 0+ 0.5+ 1) - 1]

= \sqrt 1.5 - 1

=\sqrt0.5 =0.7071

variance =\sumX 2 * P(X) - \mu 2

=[ 02   * 0.25+ 12   *0.5 + 22 *0.25 ] - (1)2

=  [( + 0+ 0.5+ 1) - 1]

= 1.5 - 1

=0.5

Add a comment
Know the answer?
Add Answer to:
Write code that when you are given the range and probability distribution of a random variable...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT