219323 Probability and Statistics for Software and Knowledge - - PowerPoint PPT Presentation

219323 probability and statistics for software and
SMART_READER_LITE
LIVE PREVIEW

219323 Probability and Statistics for Software and Knowledge - - PowerPoint PPT Presentation

219323 Probability and Statistics for Software and Knowledge Engineers Lecture 2: Random Variables Monchai Sopitkamon, Ph.D. Outline Discrete Random Variables (2.1) Continuous Random Variables (2.2) Expectation of a Random


slide-1
SLIDE 1

219323 Probability and Statistics for Software and Knowledge Engineers

Lecture 2: Random Variables

Monchai Sopitkamon, Ph.D.

slide-2
SLIDE 2

Outline

Discrete Random Variables (2.1) Continuous Random Variables (2.2) Expectation of a Random Variable

(2.3)

The Variance of a Random Variable

(2.4)

Jointly Distributed Random Variables

(2.5)

Functions and Combinations of

Random Variables (2.6)

slide-3
SLIDE 3

Discrete Random Variables (2.1)

Definition (2.1.1) Probability Mass Function (2.1.2) Cumulative Distribution Function

(2.1.3)

slide-4
SLIDE 4

Discrete Random Variables: Definition I

Random variable: a numerical value

assigned to each outcome in the sample space of a certain experiment.

E.g.1, If sample space S = {electrical,

mechanical, misuse} containing outcomes (machine breakdown problem)

– Each outcome (cause) may be assigned a repair cost (random variable) of $50, $200, and $350, respectively.

slide-5
SLIDE 5

Discrete Random Variables: Definition II

E.g.2, Using the 3 power-plant

example, suppose the random variable of interest is the number of plants that are generating electricity. Then we get a RV:

X = number of plants generating electricity = 0, 1, 2, and 3

(0, 0, 0) (0, 0, 1) (0, 1, 0) (1, 0, 0) (0, 1, 1) (1, 0, 1) (1, 1, 0) (1, 1, 1)

slide-6
SLIDE 6

Discrete Random Variables: Probability Mass Function I (2.1.2)

  • Pmf. of a random variable X is a set
  • f probability values pi assigned to

each of the values xi taken by the discrete RV.

These pi must satisfy

1. 0 ≤ pi ≤ 1 and 2. . P(X = xi ) = pi → means probability that RV X takes the value xi is equal to pi

pi

i

=1

slide-7
SLIDE 7

Discrete Random Variables: Probability Mass Function II (2.1.2)

E.g.3, From the machine breakdown

problem, suppose

– P(cost = $50) = 0.3, – P(cost = $200) = 0.2, and – P(cost = $350) = 0.5 We can summarize the pmf. as:

xi

$50 $200 $350

pi

0.3 0.2 0.5

0.3 0.2 0.5 $50 $200 $350 Repair Cost Probability

slide-8
SLIDE 8

Discrete Random Variables: Probability Mass Function III (2.1.2)

E.g.4, From e.g.2,

– P(no plants are generating electricity) = P(X = 0) = prob. of outcome (0, 0, 0) = 0.07 – P(exactly one plant is generating electricity) = P(X = 1) = P(1, 0, 0) + P(0, 1, 0) + P(0, 0, 1) = 0.04 + 0.03 + 0.16 = 0.23 – P(two plants…) = P(X = 2) …

slide-9
SLIDE 9

Discrete Random Variables: Probability Mass Function IV (2.1.2)

0.07 0.23 0.57 0.13 Number of power plants P(X=xi) 0.07 0.23 0.57 0.13 1 2 3

slide-10
SLIDE 10

Discrete Random Variables: Cumulative Distribution Function (2.1.3)

Cdf of a RV X is the function

F(x) = P(X ≤ x) = F(x) = sum of probabilities P(X = y) for all y ≤ x

– F(x) is an increasing function – . – Do examples 1 pg. 76 and 4 pg. 77 P(X = y)

y≤x

limF(x)

x→∞

=1

slide-11
SLIDE 11

Outline

Discrete Random Variables (2.1) Continuous Random Variables (2.2) Expectation of a Random Variable

(2.3)

The Variance of a Random Variable

(2.4)

Jointly Distributed Random Variables

(2.5)

Functions and Combinations of

Random Variables (2.6)

slide-12
SLIDE 12

Continuous Random Variables (2.2)

Examples of Continuous Random

Variables (2.2.1)

Probability Density Function (2.2.2) Cumulative Distribution Function

(2.2.3)

slide-13
SLIDE 13

Continuous Random Variables: Examples of Continuous Random Variables (2.2.1)

Continuous RVs can take any value within

a continuous region.

E.g., a RV X that represents the diameter

  • f a randomly selected cylinder made by a

company, whose value ranges between 49.5 - 50.5 mm.

E.g., a RV X representing the time to

failure of a newly charged battery, whose value is in the interval [0, ∞).

E.g., a RV X measuring the actual amount

  • f milk filled in a milk container by a

machine, whose value is in the interval [1.95, 2.20] liters.

slide-14
SLIDE 14

Continuous Random Variables: Probability Density Function I (2.2.2)

A pdf f(x) defines the probabilistic

properties of a continuous RV.

f(x) ≥ 0 and P(a ≤ X ≤ b) = Note that the prob. that a continuous RV X

takes any certain value a is always 0. Or, mathematically:

f (x)dx

statespace

=1

f (x)dx

a b

P(X = a) = f (x)dx

a a

= 0

slide-15
SLIDE 15

Continuous Random Variables: Probability Density Function II (2.2.2)

Difference between discrete and

continuous RVs:

– Discrete RVs can have nonzero prob.

  • f taking specific values

– Continuous RVs have zero prob. of taking specific values, but they can have nonzero prob. of falling within certain continuous regions. – Do examples 14 on pg.83 and 15 on pg.84

slide-16
SLIDE 16

Continuous Random Variables: Cumulative Distribution Function I (2.2.3)

The cdf. of a continuous RV X is,

similarly to that for a discrete RV, or

F(x) = P(X ≤ x)

F(x) is a continuous nondecreasing

function starting from 0, at the beginning of state space, and reaching 1, at the end of state space.

1 F(x) x State space

slide-17
SLIDE 17

Continuous Random Variables: Cumulative Distribution Function II (2.2.3)

We can compute cdf. F(x) from the

  • pdf. f(x) as follows:

F(x) = P(X ≤ x) = Thus, And the prob. that a RV lies within a certain region is:

Do example 14 on pg.87

f (y)dy

−∞ x

f (x) = dF(x) dx P(a ≤ X ≤ b) = P(X ≤ b) − P(X ≤ a) = F(b) − F(a)

slide-18
SLIDE 18

Outline

Discrete Random Variables (2.1) Continuous Random Variables (2.2) Expectation of a Random Variable

(2.3)

The Variance of a Random Variable

(2.4)

Jointly Distributed Random Variables

(2.5)

Functions and Combinations of

Random Variables (2.6)

slide-19
SLIDE 19

Expectation of a Random Variable (2.3)

An expectation or mean of a RV gives an

“average” measure of the RV.

However, two RVs with the same

expected value have the same average value, although their pmf. or pdf. may be very different.

Expectation of Discrete Random Variables

(2.3.1)

Expectation of Continuous Random

Variables (2.3.2)

slide-20
SLIDE 20

Expectation of Discrete Random Variables I (2.3.1)

The expected value of a discrete RV with

  • pmf. P(X = xi) = pi is

E.g.1: The expected machine repair cost

is

E(cost) = ($50x0.3) + ($200x0.2) + ($350x0.5) = $230 Over a long time period, the repairs will cost an average of $230 each.

E(X) = pixi

i

= mean of the RV (weighted average)

slide-21
SLIDE 21

Expectation of Discrete Random Variables II (2.3.1)

E.g. 4: The expected number of

power plant generating electricity is

E(X) = (0x0.7) + (1x0.23) + (2x0.57) + (3x0.13) = 1.76 The average number of power plants generating electricity at any point in time is 1.76

slide-22
SLIDE 22

Expectation of Continuous Random Variables I (2.3.2)

The expected value of a continuous

RV with pdf. f(x) is

E.g. 14: The expected diameter of a

metal cylinder is The metal cylinders have on average 50.0 mm diameter.

E(X) = xf (x)dx

statespace

= mean of the RV

E(X) = x(1.5 − 6(x − 50.0)2)dx

49.5 50.5

= 50.0

slide-23
SLIDE 23

Expectation of Continuous Random Variables II (2.3.2)

E.g. 13: The expected battery failure

time is

The batteries fail on average after one hour

  • f operation.

E(X) = x 2 (x +1)3 dx

=1