From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 55/CH6/EX6.1/6ex1.sci | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 55/CH6/EX6.1/6ex1.sci (limited to '55/CH6/EX6.1') 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 -- cgit