Computer Numerical and Statistical Method Unit 3 Calicut Univercitty Note
Computer Numerical and Statistical Method Unit 3 Calicut Univercitty Note
Probability distribution
Suppose x is a random variable assuming values x1, x2, …, xn with corresponding probabilities p1, p2,
…, pn
X p(x)
X1 p1
X2 p2
Xn pn
The probability distribution has the following properties
P(x)≥0
Σ ( p ( x ) ) =1
e.g., let x stands for number of heads obtained when 3 coins are tossed
3
x takes values 0, 1, 2, and 3 with corresponding probabilities 1 8 , 1
,
8 8
so, the probability distribution of x is
x$p(x)
1
0$
8
3
1$
8
3
2$
8
1
3$
8
All p(x) ≥0 and Σ ( p ( x ) ) =1
X,-1,0,1,2,3
P(x),0.01,0.1,0.5,0.3,0.09
Here, all p(x) ≥0 and Σ(p(x))=1. Therefore, the distribution is probability distribution
Expectation of x
expectation ( x )=Σ ¿
expectation of x is the mean value of x
variants of x
v ( x )=Σ ( x 2 p ( x )−e ( x )2 )
1
f ( 0 )=
8
3
f ( 1) =
8
3
f ( 2 )=
8
1
f ( 3 )=
8
X 0 1 2 3
P(x) 1 3 3 1
8 8 8 8
x p(x) 0 3 6 3
8 8 8
x
2
0 1 4 9
2
x p(x ) 0 3 12 9
8 8 8
Q: let f (x)=0.2 when x=1 f(x)=0.3 when x=2 f(x)=0.5 when x = 3. Find e (x) and v (x)
E(x)=2.3
V(x)=0.63
A random variable is said to be discrete if it assumes only specified values in a given interval
therefore, the variable takes the values 0, 1, and 2. This is a discrete variable and the probability
distribution of a discrete variable is a discrete probability distribution
if a random variable is assuming any real value in a given interval (a, b) then the variable is said to be
continues
X 0 1 2 3
P(x) 1/6 ½ k/10 1/30
Given the distribution is probability distribution, so we know that Σ p (x) = 1
7 k
+ =1
10 10
k 7
=1−
10 10
k 3
=
10 10
10 k =30
30
k=
10
k =3
Therefore, the distribution becomes
X 0 1 2 3
P(x) 1/6 ½ 3/10 1/30
p(1≤x≤3)=1/2+3/10+1/30=5/6
Q: evaluate k if the following function is a probability distribution. Also find p(x≤2) p (0<x<3)
F(0)=k/2
F(1)=k/5
F(2)=k/20
F(3)=k/4
X 0 1 2 3
k/2+k/5+k/20+k/4=1
k (1/2+1/5+1/20+1/4) =1
k ×1=1
k =1
Therefore, the distribution becomes
X 0 1 2 3
p(x≤2)= 1/2+1/5+1/20=3/4
p (0<x<3)= (1/5)+(1/20)=1/4
Let x be a discrete random variable assuming the values x1,x2,…,xn with corresponding probabilities
f(x1),f(x2),…,f(xn)
Then, p(x)=xi=f(xi)
I=1,2,…,n
The function f(x) is called a probability mass function provided satisfied conditions:
F(xi)≥0
Σ f(x) = 1
Let x be a continues random variable. Let the possible range of values of x be (a, b) i.e., x lies
between a and b
Let probability for x lying between x and x+dx is p (x)<x+dx is denoted by f(x, dx) then f(x) is called
the density function of x
F(x)≥0
b
∫ f ( x ) dx=1
a
∫ f ( x ) dx +∫ f ( x ) dx=∫ f ( x ) dx
a c a
Let f(x)=e^(-x)
F(x)=1/e^x
∫ f ( x ) dx=1
a
( )
∞ −x ∞
e
∫ e dx= −1
−x
0 0
−x ∞
¿ ( (−e ) 0)
( )
∞
−1
¿ x
e 0
¿
( −1e )−( −1e )
∞ 0
−1 1
¿ +
∞ 1
¿ 0+1=1
Q: for 0≤x≤1. Find k.
F(x)=0,x<2,1/18,3+2x,2≤x≤4
0,x>4
b
We have to prove that ∫ f (xdx )=1
a
∫ f ( xdx )=¿
a
Binomial distribution
A random variable x is said to follow binomial distribution with parameters n and p if its probability
function is
x n− x
f ( x )=n c x p q
Where, x = 0,1,2,…,n
P+q=1
Q=1-p
If 2 independent random variable follow binomial distribution they’re sum also follows binomial
distribution
Q=1-(1/2)
( )( )
2 2
1 1
P (getting 2 heads)=4 C2 =¿
2 2
Fitting a binomial distribution
n=8
N=256
p=1/2
q=1-(1/2)
x ( n−x )
f(x)=n c x p q
mean=np
sd=√(npq)
v=npq
putting x=0,1,2,3,4,5,6,7,8 we get all the terms of binomial distribution
| x | f(x) | N * f(x) |
|----|--------------------|-----------|
| 0 | 1/256 |1 |
| 1 | 1/32 |8 |
| 2 | 7/64 | 28 |
| 3 | 7/32 | 56 |
| 4 | 35/128 | 70 |
| 5 | 7/32 | 56 |
| 6 | 7/64 | 28 |
| 7 | 1/32 |8 |
| 8 | 1/256 |1 |
X,0,1,2,3,4,5
F,6,20,28,12,8,6
Fx,0,20,56,36,64,30
σ(fx)=
i.e., np = mean
here, n=5
calculate as normal
poison distribution
a discrete random variable (x) is said to follow poison distribution if its probability density function is
−m x
e m
p(x)=
x!
for x assuming values 0,1,2,…,∞
m is the parameter of the poison distribution. It is the mean of the poison distribution.
X,0,1,2,3,4
F,123,59,14,3,1
Fx,0,59,28,9,4
σ(fx)= 100
N=200
Σ ( fx )
m= =0.5
N
−m x
e m
p(x)=
x!
−0.5 x
e 0.5
=
x!
Q: fit a poison distribution for the following data
X,0,1,2,3,4,5,6
F,48,27,12,7,4,1,1
Normal distribution
A continues random variable x is said to follow normal distribution if its probability function is f(x)=
1
( )
2
−1 x−μ
×
√2 π σ ×e 2 σ
Marks,10-20,20-30,30-40,40-50,50-,60,60-70,70-80
F,4,22,48,66,40,16,4
X,15,25,35,45,55,65,75
Fx,60,550,1680,2970,2200,1040,100
X^2,225,625,1225,2025,3025,4725,5625
Fx^2,900,13750,58700,133650,121000,67600,22500
N=200
σ (fx)= 8800
σ(fx^2)= 418200
Σ ( fx )
mean=
N
8800
¿
200
¿ 44
√
Σ ( f x ) ∑ ( fx )
2 2
sd= −
N N
¿
√ 418200 8800 2
200
−
200
¿
√ 418200 8800 2
200
−
200
¿ √ 155
¿ 12.5
1
f ( x )=
( )
2
−1 x− μ
×
√2 π σ × e 2 σ
1
¿
( )
2
−1 x−44
×
√2 π 12.5 × e 2 12.5
Class 10 20 30 40 50 60 70 80
limit (x)
x−μ -2.72 -1.92 -1.12 -0.32 0.48 1.28 2.08 2.88
σ
Aria .5 .4726 .3686 .1255 .1844 .3997 .4812 .5
from
table
Aria
from
™interval