diff options
author | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
---|---|---|
committer | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
commit | 7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch) | |
tree | dbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /3831/CH18/EX18.7/Ex18_7.sce | |
parent | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff) | |
download | Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2 Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip |
initial commit / add all books
Diffstat (limited to '3831/CH18/EX18.7/Ex18_7.sce')
-rw-r--r-- | 3831/CH18/EX18.7/Ex18_7.sce | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/3831/CH18/EX18.7/Ex18_7.sce b/3831/CH18/EX18.7/Ex18_7.sce new file mode 100644 index 000000000..ec18ef7bc --- /dev/null +++ b/3831/CH18/EX18.7/Ex18_7.sce @@ -0,0 +1,20 @@ +// Example 18_7
+clc;funcprot(0);
+// Given data
+N=10;// The number of available students
+R=5;// The number of ordered groups
+
+// Calculation
+// (a)
+P_a=(factorial(N))/(factorial(N-R));// P_using each student only once
+// (b)
+P_b=N^R;// P_using each student more than once
+// (c)
+P_c=(factorial(N))/(factorial(N-R)*factorial(R));// C_using each student only once
+// (d)
+P_d=(factorial(N+R-1))/(factorial(N-1)*factorial(R));// C_using each student more than once
+// (e)
+R_1=4;
+R_2=6
+P_e=(factorial(N))/((factorial(R_1))*(factorial(R_2)));
+printf("\n(a)P_using each student only once=%5.0f groups \n(b)P_using each student more than once=%5.0f groups \n(c)C_using each student only once=%3.0f groups \n(d)C_using each student more than once=%4.0f groups \n(e)P_4,6=%3.0f groups",P_a,P_b,P_c,P_d,P_e);
|