summaryrefslogtreecommitdiff
path: root/1475/CH1/EX1.52
diff options
context:
space:
mode:
Diffstat (limited to '1475/CH1/EX1.52')
-rwxr-xr-x1475/CH1/EX1.52/Example_1_52.sce13
-rwxr-xr-x1475/CH1/EX1.52/Output_1_52.PNGbin0 -> 6172 bytes
2 files changed, 13 insertions, 0 deletions
diff --git a/1475/CH1/EX1.52/Example_1_52.sce b/1475/CH1/EX1.52/Example_1_52.sce
new file mode 100755
index 000000000..62d7e8a17
--- /dev/null
+++ b/1475/CH1/EX1.52/Example_1_52.sce
@@ -0,0 +1,13 @@
+// Example 1.52 A coin is tossed 10 times
+clc;
+clear;
+function result= binomial(n, k, p)
+ result = factorial(n)*(p^k)*((1-p)^(n-k))/(factorial(k)*factorial(n-k))
+endfunction
+n=10;
+k1=6;
+k2=9;
+p=1/2;
+prob1=binomial(n , k1 , p);
+prob2=binomial(n , k2 , p);
+disp(prob2," Probability of getting exactly 9 heads and 1 tail=",prob1, " Probability of getting exactly 6 heads=",p,"Probability of success=",n,"No. of time a coin is tossed=");
diff --git a/1475/CH1/EX1.52/Output_1_52.PNG b/1475/CH1/EX1.52/Output_1_52.PNG
new file mode 100755
index 000000000..bef4449f6
--- /dev/null
+++ b/1475/CH1/EX1.52/Output_1_52.PNG
Binary files differ