summaryrefslogtreecommitdiff
path: root/55/CH6/EX6.1
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /55/CH6/EX6.1
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 '55/CH6/EX6.1')
-rwxr-xr-x55/CH6/EX6.1/6ex1.sci16
1 files changed, 16 insertions, 0 deletions
diff --git a/55/CH6/EX6.1/6ex1.sci b/55/CH6/EX6.1/6ex1.sci
new file mode 100755
index 000000000..f43e5e91b
--- /dev/null
+++ b/55/CH6/EX6.1/6ex1.sci
@@ -0,0 +1,16 @@
+M=8; //number of male professors teaching calculus
+F=5; //number of female professors teaching calculus
+T=M+F ;
+disp(T,'number of ways a student can choose a calculus professor')
+
+E=[2,3,5,7]; //event of choosing a prime number less than 10
+F=[2,4,6,8]; //event of choosing an even number less than 10
+G=intersect(E,F); //event of getting an even and prime number
+H=length(E)+length(F)-length(G);
+disp(H,'event of getting an even or a prime number')
+
+E=[11,13,17,19]; //event of choosing a prime number between 10 and 20
+F=[12,14,16,18]; //event of choosing an even number between 10 and 20
+G=union(E,F); //event of choosing a number which is prime or even
+k=length(G);
+disp(k,'number of ways of choosing a number which is prime or even') \ No newline at end of file