summaryrefslogtreecommitdiff
path: root/2294/CH12
diff options
context:
space:
mode:
Diffstat (limited to '2294/CH12')
-rwxr-xr-x2294/CH12/EX12.1/EX12_1.sce6
-rwxr-xr-x2294/CH12/EX12.10/EX12_10.sce9
-rwxr-xr-x2294/CH12/EX12.11/EX12_11.sce11
-rwxr-xr-x2294/CH12/EX12.12/EX12_12.sce21
-rwxr-xr-x2294/CH12/EX12.13/EX12_13.sce8
-rwxr-xr-x2294/CH12/EX12.14/EX12_14.sce7
-rwxr-xr-x2294/CH12/EX12.16/EX12_16.sce15
-rwxr-xr-x2294/CH12/EX12.17/EX12_17.sce7
-rwxr-xr-x2294/CH12/EX12.18/EX12_18.sce15
-rwxr-xr-x2294/CH12/EX12.19/EX12_19.sce14
-rwxr-xr-x2294/CH12/EX12.2/EX12_2.sce35
-rwxr-xr-x2294/CH12/EX12.20/EX12_20.sce24
-rwxr-xr-x2294/CH12/EX12.3/EX12_3.sce7
-rwxr-xr-x2294/CH12/EX12.4/EX12_4.sce15
-rwxr-xr-x2294/CH12/EX12.5/EX12_5.sce13
-rwxr-xr-x2294/CH12/EX12.52/EX12_52.sce5
-rwxr-xr-x2294/CH12/EX12.6/EX12_6.sce5
-rwxr-xr-x2294/CH12/EX12.7/EX12_7.sce7
-rwxr-xr-x2294/CH12/EX12.8/EX12_8.sce16
-rwxr-xr-x2294/CH12/EX12.9/EX12_9.sce11
20 files changed, 251 insertions, 0 deletions
diff --git a/2294/CH12/EX12.1/EX12_1.sce b/2294/CH12/EX12.1/EX12_1.sce
new file mode 100755
index 000000000..5e4e2cd1b
--- /dev/null
+++ b/2294/CH12/EX12.1/EX12_1.sce
@@ -0,0 +1,6 @@
+//Example 12.1
+//Show whether independent or not
+disp('Two events are independent if P(A and B)=P(A)P(B)')
+disp(0.28,'P(A and B)=')
+disp(0.8*0.35,'P(A)*P(B)=')
+disp('Hence A and B are independent')
diff --git a/2294/CH12/EX12.10/EX12_10.sce b/2294/CH12/EX12.10/EX12_10.sce
new file mode 100755
index 000000000..74a97e031
--- /dev/null
+++ b/2294/CH12/EX12.10/EX12_10.sce
@@ -0,0 +1,9 @@
+//Example 12.10
+//find the required probabilities.
+disp('P(Plant shut down)=P(S1&S2&S3 is offline)or P(S1&S2 is offline)or P(S1&S3 are offline)=')
+p=(0.01)*(0.03)*(0.05)+(0.01)*(0.03)*(1-0.05)+(0.01)*(1-0.03)*(0.05)
+disp('(0.01)*(0.03)*(0.05)+(0.01)*(0.03)*(1-0.05)+(0.01)*(1-0.03)*(0.05)=')
+disp(p)
+disp(1-p,'P(Plant on line)=1-P(Plant shut down)=')
+disp('P(plant is online/S1 failed)=')
+disp((0.01)*(1-0.03)*(1-0.05)/0.01,'P(plant is online and S1 failed)/P(S1 failed)=(0.01)*(1-0.03)*(1-0.05)/0.01')
diff --git a/2294/CH12/EX12.11/EX12_11.sce b/2294/CH12/EX12.11/EX12_11.sce
new file mode 100755
index 000000000..b454c110f
--- /dev/null
+++ b/2294/CH12/EX12.11/EX12_11.sce
@@ -0,0 +1,11 @@
+//Exampple 12.11
+//Find the required probabilities.
+disp(0.45,'Let SS be the event that Ramesh pass in Signal and systems, P(SS)=')
+disp(0.32,'Let RP be the event that Ramesh pass in Random process P(RP)=')
+disp(0.15,'P(passed in both)=')
+disp('P(passed in either one subject)=P(SS U RP)')
+disp(0.45+0.32-0.15,'P(SS)+P(RP)-P(passed in both)=0.45+0.32-0.15=')
+disp(1-0.62,'P(passed in neither of the subjects)=1*P(passed in either subjects)=1-0.62=')
+disp('P( passed in one subject)=');
+disp(0.45*0.68+0.55*0.32,'P(SS)*P(failed in RP)+P(failed in SS)*P(RP)=(0.45)*(1-0.32)+(1-0.45)*(0.32)=')
+disp(1-0.45,'P(failed in SS)=1-P(SS)=1-0.45')
diff --git a/2294/CH12/EX12.12/EX12_12.sce b/2294/CH12/EX12.12/EX12_12.sce
new file mode 100755
index 000000000..c30967e73
--- /dev/null
+++ b/2294/CH12/EX12.12/EX12_12.sce
@@ -0,0 +1,21 @@
+//Example 12.12
+//Find the required probabilities.
+disp('P(A occurs exactly k times in N trials)=(n C K)[P(A)]^k[1-P(A)]^(N-k)')
+disp('P(A)=1/6 P(~A)=5/6')
+funcprot(0)
+function c = combination ( n , r )
+c = prod ( n : -1 : n-r+1 )/ prod (1:r)
+endfunction
+disp('P( 3 shows up exactly twice in 6 trials)=(6 c 2)*(1/6)^2*(5/6)^4=')
+p=combination(6,2)*(1/6)^2*(5/6)^4;
+disp(p);
+disp('P(4 shows up atleast twice)=1-P(4 does not shows up)-P(4 shows up once)')
+disp('P(4 does not show up)=(6 c 0)*(1/6)^0*(5/6)^6=')
+p=combination(6,0)*(1/6)^0*(5/6)^6;
+disp(p);
+disp('P(4 shows up once)=(6 c 1)*(1/6)^1*(5/6)^5=')
+p=combination(6,1)*(1/6)^1*(5/6)^5;
+disp(p);
+disp('P(4 shows up atleast twice)=1-(5/6)^6-(5/6)^5=')
+p=1-(5/6)^6-(5/6)^5;
+disp(p);
diff --git a/2294/CH12/EX12.13/EX12_13.sce b/2294/CH12/EX12.13/EX12_13.sce
new file mode 100755
index 000000000..7715d1e73
--- /dev/null
+++ b/2294/CH12/EX12.13/EX12_13.sce
@@ -0,0 +1,8 @@
+//Example 12.13
+//Find the required probabilities.
+disp('P(X>0.6)=1-F(0.6)=')
+disp(%e^(-1.2),'1-(1-e^(-1.2))=e^(-1.2)=')
+disp(1-%e^(-0.5),'P(X<=0.25)=(1-e^(2*(-1.2))=1-e^(-0.5)=')
+disp('P(0.4<X<=0.8)=F(0.8)-F(0.4)=')
+disp((1-%e^(-1.6))-(1-%e^(-0.8)),'(1-e^(-1.6))-(1-e^(-0.8))=')
+
diff --git a/2294/CH12/EX12.14/EX12_14.sce b/2294/CH12/EX12.14/EX12_14.sce
new file mode 100755
index 000000000..83ec3857c
--- /dev/null
+++ b/2294/CH12/EX12.14/EX12_14.sce
@@ -0,0 +1,7 @@
+//Example 12.14
+//Find the mean value of the current under following conditions.
+disp('I=Io[e^(nV)-1]')
+disp('E[I]=E[Io[e^(nV)-1]]:')
+Xo=0; X1=2;
+X=integrate('%e^(10*X)-1','X',Xo,X1);
+disp(10^(-9)*X/2,'Hence E[I]=')
diff --git a/2294/CH12/EX12.16/EX12_16.sce b/2294/CH12/EX12.16/EX12_16.sce
new file mode 100755
index 000000000..11446cad5
--- /dev/null
+++ b/2294/CH12/EX12.16/EX12_16.sce
@@ -0,0 +1,15 @@
+//Example 12.16
+//Find the following.
+Xo=0;X1=1
+X=integrate('2*X*((1-X)^2)','X',Xo,X1)
+disp(X,'E[X]=')
+Xo=0;X1=1
+X2=integrate('2*X^2*((1-X)^2)','X',Xo,X1)
+disp(X2,'E[X^2]=')
+disp(6*X+3*(X2),'E[6X+3X^2]=6E[X]+3E[X^2]=')
+disp(2*X+3,'E[2*X+3]=2E[X]+3=')
+x1=2*X+3
+disp(4*X2+9+12*X,'E[(2*X+3)^2]=E[4*X^2+9+12*X]=')
+x2=4*X2+9+12*X
+disp(x2-x1^2,'Variance of (2*X+3)=E[(2*x+3)^2]-{E[2*X+3]}^2=')
+
diff --git a/2294/CH12/EX12.17/EX12_17.sce b/2294/CH12/EX12.17/EX12_17.sce
new file mode 100755
index 000000000..ace1bdbbd
--- /dev/null
+++ b/2294/CH12/EX12.17/EX12_17.sce
@@ -0,0 +1,7 @@
+//Example 12.17
+//Probablity that R lies between 110 and 120 ohm
+clc;
+X0=110;
+X1=120;
+X=integrate('1/(130-100)','X',X0,X1);
+disp(X,'The probability that R lies between 110 and 120 is :');
diff --git a/2294/CH12/EX12.18/EX12_18.sce b/2294/CH12/EX12.18/EX12_18.sce
new file mode 100755
index 000000000..410769ac3
--- /dev/null
+++ b/2294/CH12/EX12.18/EX12_18.sce
@@ -0,0 +1,15 @@
+//Example 12.18
+//Find the mean and variance,if they exist.
+Xo=0;X1=1
+X=integrate('X*(X^3/12)','X',Xo,X1)
+disp(X,'E[X]=')
+Xo=0;X1=1
+X2=integrate('X^2*(X^3/12)','X',Xo,X1)
+disp(X2,'E[X^2]=')
+disp(X2-X^2,'Variance =E[X^2]-E[X]^2=')
+x=1:1:5;
+y=sum(x^2)/15;
+disp(y,'E[X]=sum(x*f(x))=sum(x^2)/15')
+y1=sum(x^3)/15;
+disp(y1,'E[X]=sum(x^2*f(x))=sum(x^3)/15')
+disp(y1-y^2,'Variance =E[X^2]-E[X]^2=')
diff --git a/2294/CH12/EX12.19/EX12_19.sce b/2294/CH12/EX12.19/EX12_19.sce
new file mode 100755
index 000000000..3e9235d99
--- /dev/null
+++ b/2294/CH12/EX12.19/EX12_19.sce
@@ -0,0 +1,14 @@
+//Example 12.19
+//Find the required values.
+x=[0,0;8,8;8,0]
+y=[0,0;3,3;0,3]
+deff('z=f(x,y)','z=x/6')
+I=int2d(x,y,f)
+disp(I,'E[X]=')
+deff('z=f(x,y)','z=y/6')
+I=int2d(x,y,f)
+disp(I,'E[Y]=')
+deff('z=f(x,y)','z=x*y/6')
+I=int2d(x,y,f)
+disp(I,'E[XY]=')
+
diff --git a/2294/CH12/EX12.2/EX12_2.sce b/2294/CH12/EX12.2/EX12_2.sce
new file mode 100755
index 000000000..da1a60c90
--- /dev/null
+++ b/2294/CH12/EX12.2/EX12_2.sce
@@ -0,0 +1,35 @@
+//Example 12.2
+//Find the probability of the problem.
+disp('The sample space in this case is:-');
+disp('(1,1) (1,2) (1,3) (1,4) (1,5) (1,6)');
+disp('(2,1) (2,2) (3,3) (4,4) (5,5) (6,6)');
+disp('(3,1) (2,2) (3,3) (4,4) (5,5) (6,6)');
+disp('(4,1) (2,2) (3,3) (4,4) (5,5) (6,6)');
+disp('(5,1) (2,2) (3,3) (4,4) (5,5) (6,6)');
+disp('(6,1) (2,2) (3,3) (4,4) (5,5) (6,6)');
+disp('Implies that N=36');
+disp('Let A be the event of sum 7' );
+disp('A={1,6} (2,5) (3,4) (4,3) (5,2) (6,1)} i.e n(A)=6' );
+p_a=6/36;
+disp(p_a,'Hence the probability of getting a sum 7 is p(A)=6/36=' );
+disp('Let B be the event of sum 11' );
+disp('A={5,6} (6,5) } i.e n(B)=2' );
+p_b=2/36;
+disp(p_b,'Hence the probability of getting a sum 2 is P(B)=2/36=' );
+disp('Let C be the event of sum 7 or 11' );
+disp('Probabilty of getting a sum of 7 or 11 ,P(C)=P(A)+P(B)' );
+p_c=p_a+p_b;
+disp(p_c,'Hence the probability of getting a sum 7 or 11 is P(C)=' );
+disp('Let D be the event of sum 3' );
+disp('A={1,2} (2,1)} i.e n(A)=2' );
+p_d=2/36;
+disp(p_d,'Hence the probability of getting a sum 3 is P(D)=2/36=' );
+disp('Let E be the event of sum 2 or 12' );
+disp('Probabilty of getting a sum of 2 or 12 ,P(E)=P(sum of 2)+P(sum of 12)' );
+disp('P(sum of 2)=1/36 P(sum of 12)=1/36')
+p_e=2/36;
+disp(p_e,'Hence the probability of getting a sum of 2 or 12 is P(E)=' );
+disp('Let F be the event of sum 2 or 3 0r 12' );
+disp('Probabilty of getting a sum of 2 or 3 or 12 ,P(F)=P(D)+P(E)' );
+p_f=p_d+p_e;
+disp(p_f,'Hence the probability of getting a sum 2 or 3 or 12 is P(F)=' );
diff --git a/2294/CH12/EX12.20/EX12_20.sce b/2294/CH12/EX12.20/EX12_20.sce
new file mode 100755
index 000000000..49e3075a5
--- /dev/null
+++ b/2294/CH12/EX12.20/EX12_20.sce
@@ -0,0 +1,24 @@
+Xo=0;X1=1
+X=integrate('X*(X+0.5)','X',Xo,X1)
+disp(X,'E[X]=')
+Yo=0;Y1=1
+Y=integrate('Y*(Y+0.5)','Y',Yo,Y1)
+disp(Y,'E[Y]=')
+x=[0,0;1,1;1,0]
+y=[0,0;1,1;0,1]
+deff('z=f(x,y)','z=x*y*(x+y)')
+I=int2d(x,y,f)
+disp(I,'E[XY]=')
+disp(I-X*Y,'cov(X,Y)=E[XY]-E[X]E[Y]=');
+cov=I-X*Y
+Xo=0;X1=1
+X2=integrate('X^2*(X+0.5)','X',Xo,X1)
+disp(X2,'E[X^2]=')
+Yo=0;Y1=1
+Y2=integrate('Y^2*(Y+0.5)','Y',Yo,Y1)
+disp(Y2,'E[Y^2]=')
+disp(X2-X^2,'Variance of X=E[X^2]-E[X]^2)=')
+v1=X2-X^2
+disp(Y2-Y^2,'Variance of Y=E[Y^2]-E[Y]^2)=')
+v2=Y2-Y^2
+disp(cov/sqrt(v1*v2),'Correlation coefficient of X and Y=cov(X,Y)/(s.d of X*s.d of Y)=')
diff --git a/2294/CH12/EX12.3/EX12_3.sce b/2294/CH12/EX12.3/EX12_3.sce
new file mode 100755
index 000000000..aa7aaf20e
--- /dev/null
+++ b/2294/CH12/EX12.3/EX12_3.sce
@@ -0,0 +1,7 @@
+//Example12.3
+//Find the probability that tails shows up at least once.
+disp('Let A be the event that tail shows atleast once');
+disp('Eac toss has two possible outcmes H ,T');
+disp(2^3,'Hence the total no of outcomes is 2^3=');
+disp(1-(1/2^3),'P(A)=1-Probability of getting all head i.e 1/8=');
+
diff --git a/2294/CH12/EX12.4/EX12_4.sce b/2294/CH12/EX12.4/EX12_4.sce
new file mode 100755
index 000000000..d6916b9ec
--- /dev/null
+++ b/2294/CH12/EX12.4/EX12_4.sce
@@ -0,0 +1,15 @@
+//Example 12.4
+//Probability to find the required sample size.
+disp('Let A be the event of choosing a sample size of 6 containing two red, one green , two blue and one white blue ball.');
+funcprot(0)
+function c = combination ( n , r )
+c = prod ( n : -1 : n-r+1 )/ prod (1:r)
+endfunction
+disp('The number of combination of choosing 6 balls from 14 balls is 14 C 6 ways')
+disp('The number of combination of choosing 2 red balls from 4 balls is 4 C 2 ways')
+disp('The number of combination of choosing 1 from 3 green balls is 3 C 1 ways')
+disp('The number of combination of choosing 2 from 5 green balls is 5 C 2 ways')
+disp('The number of combination of choosing 1 from 2 white balls is 2 C 1 ways')
+disp('P(A)={(4 C 2)*(3 C 1)*(5 C 2)*(2 C 1)}/(14 C 6)=')
+p=(combination(4,2)*combination(3,1)*combination(5,2)*combination(2,1))/combination(14,6);
+disp(p);
diff --git a/2294/CH12/EX12.5/EX12_5.sce b/2294/CH12/EX12.5/EX12_5.sce
new file mode 100755
index 000000000..3d2bed3a4
--- /dev/null
+++ b/2294/CH12/EX12.5/EX12_5.sce
@@ -0,0 +1,13 @@
+//Example 12.5
+//Probability to find the first white ball on the 3rd draw.
+disp('Let A be the event of drawing the first white ball at the third draw from 15 balls ')
+disp('Let W be the event of drawing a 10 white balls')
+disp('Let B be the event of drawing a 5 black balls')
+disp('Hence we have 1st draw :B 2nd Draw :B 3rd Draw :W');
+funcprot(0)
+function c = combination ( n , r )
+c = prod ( n : -1 : n-r+1 )/ prod (1:r)
+endfunction
+disp('P(A)={(5 C 1)*(5 C 1)*(10 C 1)}/{(15 C 1)*(15 C 1)*(15 C 1)}=')
+p=(combination(5,1)*combination(5,1)*combination(10,1))/(combination(15,1)*combination(15,1)*combination(15,1))
+disp(p)
diff --git a/2294/CH12/EX12.52/EX12_52.sce b/2294/CH12/EX12.52/EX12_52.sce
new file mode 100755
index 000000000..4b428f7e9
--- /dev/null
+++ b/2294/CH12/EX12.52/EX12_52.sce
@@ -0,0 +1,5 @@
+//Example 12.52
+//Find the average power.
+Xo=-(4*%pi);X1=4*%pi
+X=integrate('(1-(X/(4*%pi)))','X',Xo,X1)
+disp(X/(4*%pi),'Average Power=')
diff --git a/2294/CH12/EX12.6/EX12_6.sce b/2294/CH12/EX12.6/EX12_6.sce
new file mode 100755
index 000000000..14c4538c2
--- /dev/null
+++ b/2294/CH12/EX12.6/EX12_6.sce
@@ -0,0 +1,5 @@
+//Example 12.6
+//To find the required probabilities.
+disp(100/500,'P(1 kilo-ohms)=100/500=');
+disp(140/500,'P(20%)=140/500=');
+disp((125/500)/(260/500),'P(10%/10 kilo-ohms)={P(10%)&P(10 kilo-ohms)}/{P(10 kilo-ohms)}=(125/500)/(260/500)');
diff --git a/2294/CH12/EX12.7/EX12_7.sce b/2294/CH12/EX12.7/EX12_7.sce
new file mode 100755
index 000000000..24092c305
--- /dev/null
+++ b/2294/CH12/EX12.7/EX12_7.sce
@@ -0,0 +1,7 @@
+//Example 12.7
+//find the required probabilities.
+disp(((1/2)*(1/2))+((2/3)*(1/2)),'P(PMOS is chosen)=(P{PMOS/4}/P{4})+(P{PMOS/3}/P{3})=((1/2)*(1/2))+((2/3)*(1/2))=');
+disp('Using Bayes Rule:')
+disp('P{4/NMOS}=P(NMOS/4)*P(4)/P(NMOS)=')
+disp('(1/2)*(1/2)/(1-(7/12))=')
+disp((1/2)*(1/2)/(1-(7/12)))
diff --git a/2294/CH12/EX12.8/EX12_8.sce b/2294/CH12/EX12.8/EX12_8.sce
new file mode 100755
index 000000000..769d783c6
--- /dev/null
+++ b/2294/CH12/EX12.8/EX12_8.sce
@@ -0,0 +1,16 @@
+//Example 12.8
+//Find the given probabillities.
+disp('P{R1/So}=0.15 and P{Ro/S}=0.75');
+disp((1-0.15),'P{Ro/So}1-P{R1/So}');
+disp((1-0.075),'P{R1/S1}1-P{Ro/S1}');
+disp('P{R1}=P{R1/So}P(So)+P{R1/S1}P{S1}=');
+disp(((0.15)*(0.85)+(0.925)*(1-0.85)),'(0.15)(0.85)+(0.925)(1-0.85)=');
+disp('Using Bayes Rule:')
+disp('P{S1/R1}=(P{R1/S1}P{S0})/P{R0}=');
+p=(0.925*0.15/0.266)
+disp(p,'(0.925)(1-0.85)/0.266=');
+disp('P{Ro/So}P{So}/P{Ro}');
+disp('P{Ro/So}P{So}/(P{Ro/So}P{So}+P{Ro/S1}P{S1}=');
+p=(0.85)*(0.85)/((0.85)*(0.85)+(0.075)*(0.15))
+disp(p,'(0.85)(0.85)/((0.85)(0.85)+(0.075)(0.15))=');
+
diff --git a/2294/CH12/EX12.9/EX12_9.sce b/2294/CH12/EX12.9/EX12_9.sce
new file mode 100755
index 000000000..fede892df
--- /dev/null
+++ b/2294/CH12/EX12.9/EX12_9.sce
@@ -0,0 +1,11 @@
+//Example 12.9
+//Find the required probabilities.
+disp('Let H be the event that Husband is alive')
+disp('Let W be the event that wife is alive')
+disp('P(H)=0.85 P(W)=0.9')
+disp(0.85*0.9,'P(both alive)=P(H)P(W)=')
+disp(0.15*0.1,'P(neither alive)=(1-P(H))(1-P(W))=')
+disp(0.85+0.9-0.765,'P(Atleast one is alive)=P(H)+P(W)-P(both are alive)=')
+disp('P(only one is alive)=P(Husband is alive and wife is dead)OR P(Husband is dead and wife is alive)')
+disp('P(H)(1-P(W))+(1-P(H))P(W)=')
+disp((0.85)*(1-0.9)+(1-0.85)*(0.9),'(0.85)(1-0.9)+(1-0.85)(0.9)=')