summaryrefslogtreecommitdiff
path: root/331/CH6
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /331/CH6
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '331/CH6')
-rwxr-xr-x331/CH6/EX6.1/Example_6_1.sce26
-rwxr-xr-x331/CH6/EX6.2/Example_6_2.sce32
-rwxr-xr-x331/CH6/EX6.3/Example_6_3.sce32
-rwxr-xr-x331/CH6/EX6.4/Example_6_4.sce37
-rwxr-xr-x331/CH6/EX6.5/Example_6_5.sce43
-rwxr-xr-x331/CH6/EX6.6/Example_6_6.sce15
-rwxr-xr-x331/CH6/EX6.7/Example_6_7.sce19
-rwxr-xr-x331/CH6/EX6.8/Example_6_8.sce19
-rwxr-xr-x331/CH6/EX6.9/Example_6_9.sce52
9 files changed, 275 insertions, 0 deletions
diff --git a/331/CH6/EX6.1/Example_6_1.sce b/331/CH6/EX6.1/Example_6_1.sce
new file mode 100755
index 000000000..69ff814d0
--- /dev/null
+++ b/331/CH6/EX6.1/Example_6_1.sce
@@ -0,0 +1,26 @@
+//Caption:Probability of occurrence of 'A' given that 'B' has occurred
+//P(A/B)
+//Example6.1
+//Page 171
+clear;
+clc;
+//A be the event that an employee's monthly salary is more than Rs.15,000
+//B be the event that the employee is a regular taker of Alpha Brand Tea
+n = 200; //total number of employee's
+A_intersec_B = 20; //Alpha Brand tesa takers both in A and B
+P_AinterB = A_intersec_B/n;//Probability that Alpha brand tea takers both in A&B
+B = 120; //Number of Alpha Brand tea takers
+P_B = B/n; // Probility of number of Alpha brand tea takers
+P_AB = P_AinterB/P_B;
+disp(P_AinterB,'Probability that Alpha brand tea takers both in A&B P(A intersection B)=')
+disp(P_B,'Probility of number of Alpha brand tea takers P(B)=')
+disp('The probability that employee is having monthly salary more than')
+disp(P_AB,'Rs.15,000, if the employee is a regular taker of Alpha brand Tea P(A/B)=')
+//Result
+//Probability that Alpha brand tea takers both in A&B P(A intersection B)=
+// 0.1
+//Probility of number of Alpha brand tea takers P(B)=
+// 0.6
+//The probability that employee is having monthly salary more than
+//Rs.15,000, if the employee is a regular taker of Alpha brand Tea P(A/B)=
+// 0.1666667 \ No newline at end of file
diff --git a/331/CH6/EX6.2/Example_6_2.sce b/331/CH6/EX6.2/Example_6_2.sce
new file mode 100755
index 000000000..7bf68a7bf
--- /dev/null
+++ b/331/CH6/EX6.2/Example_6_2.sce
@@ -0,0 +1,32 @@
+//Caption: Cumulative distribution of the binomial distribution
+//F(X,n,p)
+//Example6.2
+//Page 176
+clear;
+clc;
+//(a). Probability of 0 head
+X1 = 0;// 0 head
+n = 10; //number of trials
+Pr = 0.5; //Probability of success in each binomial trial
+Ompr = 1-Pr; //Probability of failure in each binomial trial
+[P1,Q1]=cdfbin("PQ",X1,n,Pr,Ompr);
+disp(P1,'Probability of zero head P(X=0,10,0.5)=')
+//(b). Probability of 3 head
+X2 =3;// 3 head
+P2 = (factorial(n)/(factorial(X2)*factorial(n-X2)))*(Pr^X2)*(Ompr^(n-X2));
+disp(P2,'Probability of three heads P(X=3,10,0.5)=')
+//(c). at most 2 heads
+X3 = 2;
+[P3,Q3]=cdfbin("PQ",X3,n,Pr,Ompr);
+disp(P3,'Probability of atmost 2 heads P(X<=2,10,0.5)=')
+//(d). at least 3 heads
+disp(1-P3,'Probability of atleat 3 heads P(X>=3,10,0.5)=')
+//Result
+//Probability of zero head P(X=0,10,0.5)=
+// 0.0009766
+//Probability of three heads P(X=3,10,0.5)=
+// 0.1171875
+//Probability of atmost 2 heads P(X<=2,10,0.5)=
+// 0.0546875
+//Probability of atleat 3 heads P(X>=3,10,0.5)=
+// 0.9453125 \ No newline at end of file
diff --git a/331/CH6/EX6.3/Example_6_3.sce b/331/CH6/EX6.3/Example_6_3.sce
new file mode 100755
index 000000000..484271d17
--- /dev/null
+++ b/331/CH6/EX6.3/Example_6_3.sce
@@ -0,0 +1,32 @@
+//Caption: Cumulative distribution of the binomial distribution
+//F(X,n,p)
+//Example6.3
+//Page176
+clear;
+clc;
+//(a). Probability of nil project in time
+X1 = 0;// nil project
+n = 5; //number of trials
+Pr = 0.9; //Probability of success in each binomial trial
+Ompr = 1-Pr; //Probability of failure in each binomial trial
+[P1,Q1]=cdfbin("PQ",X1,n,Pr,Ompr);
+disp(P1,'Probability of zero head P(X=0,10,0.5)=')
+//(b). two projects in time
+X2 = 2;// two projects
+P2 = (factorial(n)/(factorial(X2)*factorial(n-X2)))*(Pr^X2)*(Ompr^(n-X2));
+disp(P2,'Probability of three heads P(X=2,10,0.5)=')
+//(c). at most one project in time
+X3 = 1;
+[P3,Q3]=cdfbin("PQ",X3,n,Pr,Ompr);
+disp(P3,'Probability of atmost 2 heads P(X<=1,10,0.5)=')
+//(d). at least two projects in time
+disp(1-P3,'Probability of atleat 3 heads P(X>=2,10,0.5)=')
+//Result
+//Probability of zero head P(X=0,10,0.5)=
+// 0.00001
+//Probability of three heads P(X=2,10,0.5)=
+// 0.0081
+//Probability of atmost 2 heads P(X<=1,10,0.5)=
+// 0.00046
+//Probability of atleat 3 heads P(X>=2,10,0.5)=
+// 0.99954 \ No newline at end of file
diff --git a/331/CH6/EX6.4/Example_6_4.sce b/331/CH6/EX6.4/Example_6_4.sce
new file mode 100755
index 000000000..590ea07a7
--- /dev/null
+++ b/331/CH6/EX6.4/Example_6_4.sce
@@ -0,0 +1,37 @@
+//Caption: Poisson distribution
+//Example6.4
+//Page179
+clear;
+clc;
+//(a): Exactly 0 customer will arrive in 10 minutes interval
+X1= 0; //no. of customer
+Mean = 4;//mean arrival rate of 4 per 10 minutes
+[P1,Q1]=cdfpoi("PQ",X1,Mean)
+disp(P1,'Exactly 0 customer will arrive P(X=0,4) is =')
+//(b): Exactly 2 customers will arrive in 10 minutes interval
+X2 =2; //no. of customer
+P2 = exp(-Mean)*(Mean^X2)/(factorial(2))
+disp(P2,'Exactly 2 customer will arrive P(X=2,4) is =')
+//(c): at most 2 customers will arrive in 10 minutes interval
+[P3,Q3]=cdfpoi("PQ",X2,Mean)
+disp(P3,'Atmost 2 customer will arrive P(X<=2,4) is =')
+//(d): at least 3 customers will arrive in 10 minutes interval
+X3 =3;
+P4 = 1-P3
+disp(P4,'At least 3 customer will arrive P(X>=3,4) is=')
+//Result
+//Exactly 0 customer will arrive P(X=0,4) is =
+//
+// 0.0183156
+//
+// Exactly 2 customer will arrive P(X=2,4) is =
+//
+// 0.1465251
+//
+// Atmost 2 customer will arrive P(X<=2,4) is =
+//
+// 0.2381033
+//
+// At least 3 customer will arrive P(X>=3,4) is=
+//
+// 0.7618967 \ No newline at end of file
diff --git a/331/CH6/EX6.5/Example_6_5.sce b/331/CH6/EX6.5/Example_6_5.sce
new file mode 100755
index 000000000..03644c512
--- /dev/null
+++ b/331/CH6/EX6.5/Example_6_5.sce
@@ -0,0 +1,43 @@
+//Caption: Poisson Distribution
+//Example6.5
+//Page179
+clear;
+clc;
+//(a): Probability no piece in the sample is defective
+X1= 0; //nil defective
+p= 0.04;//probability that an inspected piece will be defective
+n = 25; //number of sample units
+Mean = n*p;//mean of the poisson distribution
+[P1,Q1]=cdfpoi("PQ",X1,Mean)
+disp(P1,'No piece will be defective P(X=0,1) is =')
+
+//(b): Probability 3 pieces in the sample will be defective
+X2 = 3; //3 pieces in the sample will be defective
+P2 = exp(-Mean)*(Mean^X2)/(factorial(X2))
+disp(P2,'Probability 3 pieces will be defective P(X=3,1) is =')
+
+//(c): at most 2 pieces will be defective
+X3 = 2;
+[P3,Q3]=cdfpoi("PQ",X3,Mean)
+disp(P3,'Atmost 2 pieces will be defective P(X<=2,1) is =')
+
+//(d): at least 3 pieces will be defective
+P4 = 1-P3
+disp(P4,'At least 3 pieces will be defective P(X>=3,1) is=')
+//Result
+//
+// No piece will be defective P(X=0,1) is =
+//
+// 0.3678794
+//
+// Probability 3 pieces will be defective P(X=3,1) is =
+//
+// 0.0613132
+//
+// Atmost 2 pieces will be defective P(X<=2,1) is =
+//
+// 0.9196986
+//
+// At least 3 pieces will be defective P(X>=3,1) is=
+//
+// 0.0803014
diff --git a/331/CH6/EX6.6/Example_6_6.sce b/331/CH6/EX6.6/Example_6_6.sce
new file mode 100755
index 000000000..59f5cdf8c
--- /dev/null
+++ b/331/CH6/EX6.6/Example_6_6.sce
@@ -0,0 +1,15 @@
+//Caption: Uniform Distribution
+//Example6.6
+//Page181
+clear;
+clc;
+a = 230; // lower limit
+b = 450; //upper limit
+P = (1/(b-a)); //uniform distribution of daily demand for packed meals
+Demand = 0.8; //service level of satisfying the demand of the canteen
+Q = (1/P)*Demand+a;
+disp(Q,'The demand of the product which can be satisfied w.r.to the given service level is=')
+//Result
+//The demand of the product which can be satisfied w.r.to the given service level is=
+//
+// 406. \ No newline at end of file
diff --git a/331/CH6/EX6.7/Example_6_7.sce b/331/CH6/EX6.7/Example_6_7.sce
new file mode 100755
index 000000000..40c491fed
--- /dev/null
+++ b/331/CH6/EX6.7/Example_6_7.sce
@@ -0,0 +1,19 @@
+//Caption: Exponential Distribution
+//Example6.7
+//Page183
+clear;
+clc;
+//Example6.7(a): The probability that the service time of the terminal Less than 0.5 hr
+Mean = 30; //Service rate of the terminal per day
+Mean = Mean/24; //Service rate of the terminal per hour
+X1 = 0.5;
+F = 1-exp(-Mean*X1);
+disp(F,'The cumulative probability distribution P(X<=0.5) is =');
+//Example6.7(b): The probability that the service time of the terminal greate than 0.75 hr
+X2 = 0.75;
+F = 1-exp(-Mean*X2);
+disp(1-F,'The cumulative probility distribution P(X>=0.75) is =' );
+//Result
+//The cumulative probability distribution P(X<=0.5) is = 0.4647386
+//
+//The cumulative probility distribution P(X>=0.75) is = 0.3916056 \ No newline at end of file
diff --git a/331/CH6/EX6.8/Example_6_8.sce b/331/CH6/EX6.8/Example_6_8.sce
new file mode 100755
index 000000000..7af820d90
--- /dev/null
+++ b/331/CH6/EX6.8/Example_6_8.sce
@@ -0,0 +1,19 @@
+//Caption: Exponential Distribution
+//Example6.8
+//Page183
+clear;
+clc;
+//Example6.8(a): The probability that the execution time of programs < 4 minutes
+T = 5; //Average execution time of the programs
+X1 = 4;
+F = 1-exp(-X1/T);
+disp(F,'The probability that the execution time of programs < 4 minutes P(X<=4) is =');
+//Example6.8(b): The probability that the execution time of programs > 6 minutes
+X2 =6;
+F = 1-exp(-X2/T);
+disp(1-F,'The probability that the execution time of programs > 6 minutes P(X>=6) is =');
+//Result
+//The probability that the execution time of programs < 4 minutes P(X<=4) is =
+// 0.5506710
+//The probability that the execution time of programs > 6 minutes P(X>=6) is =
+// 0.3011942 \ No newline at end of file
diff --git a/331/CH6/EX6.9/Example_6_9.sce b/331/CH6/EX6.9/Example_6_9.sce
new file mode 100755
index 000000000..0c708db7a
--- /dev/null
+++ b/331/CH6/EX6.9/Example_6_9.sce
@@ -0,0 +1,52 @@
+//Caption: Normal Distribution
+//Example6.9
+//Page185
+clear;
+clc;
+//Example6.9(a):Probability that the monthly income < Rs.11,000
+X = 11000;
+Mean = 10000;
+Std = 2000;
+n = 200; //sample number of respondents
+[P,Q]=cdfnor("PQ",X,Mean,Std)//Cumulative normal distribution
+disp(P,'The probability that the monthly income is < Rs.11,000 is =')
+disp(n*P,'The number of respondents having income is less than Rs.11,000 =')
+
+//Example6.9(b): Probability that the monthly income > Rs.12,000
+X = 12000;
+[P,Q]=cdfnor("PQ",X,Mean,Std)//Cumulative normal distribution
+disp(Q,'The probability that the monthly income is > Rs12,000 is =')
+disp(n*Q,'The number of respondents having income is greater than Rs.12,000 =')
+
+//Example6.9(c): Probability that the monthly income is in between Rs.7,000 and
+//Rs.11,200
+X1 = 11200;
+X2 = 7000;
+[P1,Q1]=cdfnor("PQ",X1,Mean,Std);
+[P2,Q2]=cdfnor("PQ",X2,Mean,Std);
+disp(P1-P2,'The probability that the monthly income in between Rs.7,000 & Rs.11,200 is =');
+disp(n*(P1-P2),'The number of respondents having income in between Rs.7,000 & Rs.11,200 is =')
+//Result
+//The probability that the monthly income is < Rs.11,000 is =
+//
+// 0.6914625
+//
+// The number of respondents having income is less than Rs.11,000 =
+//
+// 138.29249
+//
+// The probability that the monthly income is > Rs12,000 is =
+//
+// 0.1586553
+//
+// The number of respondents having income is greater than Rs.12,000 =
+//
+// 31.731051
+//
+// The probability that the monthly income in between Rs.7,000 & Rs.11,200 is =
+//
+// 0.6589397
+//
+// The number of respondents having income in between Rs.7,000 & Rs.11,200 is =
+//
+// 131.78794 \ No newline at end of file