[SOLVED] AI5002-Assignment 2 Probability and Random Variables

24.99 $

Programming resource
Digital learning resource
Category:
Practical programming resource
Suitable for guided study and reference
Tutor guidance available when needed

Description

Rate this product
  1. Problem

In a meeting, 70% of the members favour and 30% oppose a certain proposal. A member is se-

lected at random and we take X = 0 if he opposed, Download latex code from hereand X = 1 if he is in favour. Find E(X) and Var (X).

  1. Solution

A member opposes the proposal : X=0;

A member favours the proposal : X=1;

P(X=0) = 70 % = 0.7 P(X=1) = 30 % =0.3

n

X

                         E(X) =         xipi

i=1

(1)
= 1 × 0.7 + 0 × 0.3 = 0.7 (2)
=⇒ E(X) = 0.7 (3)
n

2 X 2

E(X ) =         (xi) pi

i=1

(4)
= 12 × 0.7 + 02 × 0.3 = 0.7 (5)
Var(X) = E(X2) − [E(X)]2 (6)
= 0.7 − 0.72 = 0.21 (7)
=⇒ Var(X) = 0.21 (8)

Similar result is also obtained with random samples generated using the python code.

Figure 1: Result obtained from python code

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.