**Chinese Fortune Casting Example Demo** This page is under development. Comments are welcome, but please load any comments in the comments section at the middle of the page. Thanks, [gold] ---- Here is some starter code for Chinese Fortune Casting Example Demo. The impetus for this calculator was checking some iching probabilities on the chinese bronze example. Its easy enough to plug in formulas/subroutines into the chinese bronze example. Most of the checked testcases involve flipping two sided objects like coins or popsicle sticks. ---- In planning any software, it is advisable to gather a number of testcases to check the results of the program. ---- Extra Credit For a system of one die with kk sides of the number N tosses, the sample size would be: set aa [ expr { ($kk**$N)} ] For example, a 6 sided die with 2 tosses would have a sample size of 6**2 or 36. set aa [ expr { ( 6**2 )} ] The probability of two dice having the same face like snake eyes (1:1) on one throw is 1/(sample size) or 1/36. set pp [ expr { 1./(6**2) } ] ---- The following sums the numbers on two faces. For 2 dice of 6 sides, the probability of a number 7 coming up is 0.1666 In pseudocode statements, the probability of two dice landing with sum 7 would be the number of combinations that add up to seven over the number of all possible combinations from throwing 2 dice. Such a $list can generated in the auxillary TCL script at the bottom of page. prob. pseudocode = nom ($list) / denom ( $list) prob. pseudocode = llength [lsearch -all $list 7 ] / [llength $list ] prob. pseudocode = [llength [lsearch -all $list 7 ]] / [llength $list ] This would find our probability of throw 7 on a one time basis. For the calculator, this process could be generalized into a subroutine that generated a list for 2 to N sides: list(N), an expected dice throw as $facenumber, counted the number of throws showing $facenumber in list(N), and counted all the elements in the list(N). prob. pseudocode = [llength [lsearch -all $list(N) $facenumber ]] / [llength $list(N) ] Also, another foreach loop in the list generator could probably generate the possible throws of three dice. ---- **Screenshots Section** ---- **Comments Section** Please place any comments here, Thanks. [gold] Changes. ---- **References** * [factorial] * [Slot_Calculator_Demo] * http://www.knowyourluck.com/coins3u.html (currently 404) * http://www.learning.com/pdfs/et/activity-35-cointoss.pdf * http://stattrek.com/Tables/Binomial.aspx Binomial Distribution Calculator * [Sample Math Programs] modified [PSE} operation tables to generate throw do-loops * http://hyperphysics.phy-astr.gsu.edu/hbase/math/dice.html Statistics of Dice Throw * http://wizardofodds.com/gambling/dice.html Dice Probability basics * http://www.cobalt.chem.ucalgary.ca/ziegler/educmat/chm386/rudiment/mathbas/probab.htm Probability * http://gwydir.demon.co.uk/jo/probability/calcinfo.htm Calculating probabilities of throwing two dice The Math Forum,Date: 05/16/99 at 16:24:04 From: Doctor Anthony Subject: Re: Probability dealing with combinations of dice The Math Forum,Date: 12/05/2001 at 00:36:56 From: Doctor Jeremiah Subject: Re: Probability of dicehttp://wiki.tcl.tk/13243 Throwing Two Dice * [throw a dice] * [Dice] Google Answers Probability of Coin Flip.mht 2 Dice Rolls Probability-Statistics - Separate.mht http://mathforum.org/library/drmath/view/56627.html **appendix TCL programs** ====== ***FIRST VERSION*** #start of deck #start of deck #start of deck #start of deck #start of deck #end of deck #end of deck #end of deck #end of deck #end of deck #end of deck ====== <> Toys | Example | Calculator | Mathematics