diff options
Diffstat (limited to '3808/CH7/EX7.11/Ex7_11.sce')
-rw-r--r-- | 3808/CH7/EX7.11/Ex7_11.sce | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/3808/CH7/EX7.11/Ex7_11.sce b/3808/CH7/EX7.11/Ex7_11.sce new file mode 100644 index 000000000..025b4134f --- /dev/null +++ b/3808/CH7/EX7.11/Ex7_11.sce @@ -0,0 +1,23 @@ +//Chapter 07: Discrete Probability + +clc; +clear; + +spam_msg=2000 //no of spam messages +nspam_msg=1000 //no of messages that are not spam +o_msg_spam=400 //occurrence of stock in spam +o_msg_nspam=60 //occurrence of stock in non spam +o_msg1_spam=200 //occurrence of undervalued in spam +o_msg1_nspam=25 //occurrence of undervalued in non spam +threshold=0.9 +p1=o_msg_spam/spam_msg +q1=o_msg_nspam/nspam_msg +p2=o_msg1_spam/spam_msg +q2=o_msg1_nspam/nspam_msg + +r=(p1*p2)/(p1*p2+q1*q2) + +if r>threshold then + disp(r,'R=') + disp('Reject') +end |