summaryrefslogtreecommitdiff
path: root/1286/CH15/EX15.6/15_6.sce
diff options
context:
space:
mode:
Diffstat (limited to '1286/CH15/EX15.6/15_6.sce')
-rwxr-xr-x1286/CH15/EX15.6/15_6.sce22
1 files changed, 22 insertions, 0 deletions
diff --git a/1286/CH15/EX15.6/15_6.sce b/1286/CH15/EX15.6/15_6.sce
new file mode 100755
index 000000000..e14fde6dd
--- /dev/null
+++ b/1286/CH15/EX15.6/15_6.sce
@@ -0,0 +1,22 @@
+clc
+//initialisation
+a1=2
+a2=6
+a3=16
+a4=2
+b1=1
+b2=3
+b3=4
+b4=7
+//CALCULATIONS
+a=a1+a2+a3+a4
+x=a1*b1+a2*b2+a3*b3+a4*b4
+p2=a1/a
+p6=a2/a
+p16=a3/a
+d=x/a
+//results
+printf(' \n probability of state 2= % 1f ',p2)
+printf(' \n probability of state 6= % 1f ',p6)
+printf(' \n probability of state 16= % 1f ',p16)
+printf(' \n value of <x>= % 1f ',d)