المدخل الى البرمجة الهيكلية بلغة البيسك — الصفحة ١٩٩

۱۸۱ مثال ٢ : قذفنا ثلاثة أحجار نرد معا. أكتب فراغ العينة وأوجد عدد عناصره ، وأوجد عدد عناصر الحادثة مجموع الأرقام مساويا لـ 15 مثلا". n = 15 count.event = 0 count.sample=0 for i 1 to 6 for j = 1 to 6 for k= 1 to 6 count.sample = count.sample + 1 print "("; i ;","; j ;"," k; ")"; if i+j+k=n then " count.event = count.event + 1 end if next k next j next i print print "The cardinality of the sample space is ";count.sample print print "the cardinality of the event that the sum of " print "the three numbers is "; ;" is ";count.event end (1, 1, 1) 1, 1, 2 )( 1, 1, 3 )( 1,1,4)(1, 1, 5) (1, 1, 6) 1, 2, 1 )( 1, 2, 2 )( 1, 2, 3 )( 1,2,4) (1,2,5) 1, 2, 6 )( 1, 3, 1 )( 1,3,2)(1, 3, 3) (1,3,4)(1, 3, 5 )( 1, 3, 6 )( 1,4,1)(1,4,2) (1,4,3 ) 1, 4, 4 )( 1, 4, 5 )( 1,4,6 )( 1, 5, 1 ) -( 1, 5, 2 )( 1, 5, 3 )( 1, 5, 4 )( 1,5,5)(1,5,6) (1,6,1 ) 1,6, 2 )( 1, 6, 3 )( 1, 6, 4 )( 1, 6, 5) (1,6,6 )( 2, 1, 1 )( 2, 1, 2 )( 2, 1, 3 )( 2, 1, 4) (2,1,5)(2, , 6 )( 2, 2, 1 )( 2, 2, 2 )( 2, 2, 3) الحل: وتكون النتيجة
ج٢ ص١٨١

نص مستخرج آليًا من الصورة، وقد يقع فيه خطأ.