Programming and probability: a practical application of Principles and Standards for School Mathematics.This article describes ideas for teaching students critical concepts in probability through novel approaches available with today's technology. These teaching ideas include student work in programming that makes use of the newest features of calculators, including the graphing capabilities. These features offer students valuable experiences in visualizing visualizing, v 1., holding an image in one's mind. 2., forming an image of a goal or destination in one's mind before undertaking it, so as to facilitate success. the basic concepts of probability. The calculator calculator or calculating machine, device for performing numerical computations; it may be mechanical, electromechanical, or electronic. The electronic computer is also a calculator but performs other functions as well. programs introduced are easy to understand by the beginning programmer (1) A hardware device used to customize a programmable logic chip such as a PAL, GAL, EPROM, etc. See PROM programmer. (2) A person who designs the logic for and writes the lines of codes of a computer program. and are instructional in showing students the potential value of learning how to program. The activities are at a level appropriate for high school students and in certain cases, for undergraduate students taking introductory courses. Students will find the programs easy to reproduce re·pro·duce v. 1. To produce a counterpart, an image, or a copy of something. 2. To bring something to mind again. 3. To generate offspring by sexual or asexual means. and change, making them very useful for exploring basic probability ideas and for exploring other mathematical relationships. Experience gained by students doing these activities can provide them a solid foundation for higher-level programming in personal comp comp See comparison. uter and mainframe mainframe Digital computer designed for high-speed data processing with heavy use of input/output units such as large-capacity disks and printers. They have been used for such applications as payroll computations, accounting, business transactions, information retrieval, environments. Ideas for encouraging student conjectures This is an incomplete list of mathematical conjectures. They are divided into four sections, according to their status in 2007. See also:
********** One of the six core principles in the Principles and Standards for School Mathematics Principles and Standards for School Mathematics was a document produced by the National Council of Teachers of Mathematics [1] in 2000 to set forth a national vision for precollege mathematics education in the US and Canada. (National Council of Teachers of Mathematics The National Council of Teachers of Mathematics (NCTM) was founded in 1920. It has grown to be the world's largest organization concerned with mathematics education, having close to 100,000 members across the USA and Canada, and internationally. (NCTM NCTM National Council of Teachers of Mathematics NCTM Nationally Certified Teacher of Music NCTM North Carolina Transportation Museum NCTM National Capital Trolley Museum NCTM Nationally Certified in Therapeutic Massage ), 2000) is that technology must support mathematical investigations by students in the classroom. The use of technology allows students to examine mathematical relationships in various types of representation, including graphical, algebraic 1. (language) ALGEBRAIC - An early system on MIT's Whirlwind. [CACM 2(5):16 (May 1959)]. 2. (theory) algebraic - In domain theory, a complete partial order is algebraic if every element is the least upper bound of some chain of compact elements. , and computational Having to do with calculations. Something that is "highly computational" requires a large number of calculations. . In particular, the beginning study of probability is well suited for enhancement through technology. In cases where it may be difficult or impossible to compute To perform mathematical operations or general computer processing. For an explanation of "The 3 C's," or how the computer processes data, see computer. actual probabilities, simulations can often be effectively used to determine the probability of occurrences of certain events. With the use of computers and calculators, the ability to perform large numbers of simulations in an efficient manner has become much more achievable. Activities that require the use of current calculators such as the TI-83 Plus[R] can offer students an introduction to a programming language. The code for calculator programming is in an easy-to-understand language with procedures related to simulations simple to implement. Students can gather computational data as well as represent data graphically in the form of histograms, providing a visual representation of simulation results. In the activities presented here, students have the opportunity to perform some basic probability simulations, and to compare their results to the predicted probabilities based on established probability distributions Many probability distributions are so important in theory or applications that they have been given specific names. Discrete distributions With finite support
adj. Requiring no proof or explanation. self -ev .
The basic functions offered through this programming allows students
unique opportunities for problem solving problem solvingProcess involved in finding a solution to a problem. Many animals routinely solve problems of locomotion, food finding, and shelter through trial and error. as well as practice in writing programs for specific uses. Writing programs similar to those presented in this article requires that students have a good understanding of symbolic algebra algebra, branch of mathematics concerned with operations on sets of numbers or other elements that are often represented by symbols. Algebra is a generalization of arithmetic and gains much of its power from dealing symbolically with elements and operations (such as and its use for representing relationships, especially the practicality of using iterative it·er·a·tive adj. 1. Characterized by or involving repetition, recurrence, reiteration, or repetitiousness. 2. Grammar Frequentative. Noun 1. processes in simulations that are modeled using calculator programming. The study of iterative processes such as those available through programming loops helps students better understand logic and supports some of the basic ideas related to discrete mathematics Discrete mathematics, also called finite mathematics or Decision Maths, is the study of mathematical structures that are fundamentally discrete, in the sense of not supporting or requiring the notion of continuity. (NCTM, 2000). Under the discussion on probability and statistics See the separate articles on probability or the article on statistics. Statistical analysis depends on the characteristics of particular probability distributions, and the two topics are normally studied together. in school mathematics, NCTM emphasizes that students need to develop an understanding of critical ideas in basic probability (NCTM, 2000). Among these critical understandings identified for high school students are the concepts of sample space, probability distributions, and the ideas behind constructing them. When appropriate, activities should require students to run simulations to construct empirical probability Empirical probability, also known as a posteriori probability, relative frequency, or experimental probability, is the ratio of the number favorable outcomes to the total number of trials[1] distributions. With the use of technology, it is easier and more efficient to compare multiple simulation runs than if they were done by hand. Using the TI-83 Plus[R] programming capabilities, one can easily design special assignments that can be used with students of courses such as discrete mathematics as well as in the training of mathematics teachers. Even if students have had no prior experience with a formal programming language, they are able to quickly learn the basics of TI-83 Plus[R] programming. The following discussion introduces basic commands that can be used effectively and easily as part of a study of probability. One of the most useful functions available on the TI-83 Plus[R], the randInt command, is very applicable to the running of simulations. For example, the command randInt(1,6) generates a random integer integer: see number; number theory value between 1 and 6 with each of the values 1, 2,...,6 having the same probability of being generated. That is, P(l) = P(2) = ... = P(6) = 1/6 [approximately ap·prox·i·mate adj. 1. Almost exact or correct: the approximate time of the accident. 2. equal to] .1667. Therefore, randInt(1,6) simulates the roll of a single, fair die that has 6 sides labeled 1, 2, ..., 6. The first program RANDNO described in the following section is one appropriate for introducing students to key programming features well suited for examining some of the introductory probability ideas. In an effort to offer the reader a better understanding of these features, each major section for the initial program includes a description detailing special commands and the purpose of that particular code. The calculator screens in this document were provided using the TI-Graph Link 83-Plus[R] and copied directly from the calculator. All programming code has been checked for accuracy through repeated runs of each program. INTRODUCTION TO THE PROGRAM RANDNO The first section of the program titled RANDNO shown in Figure 1 assigns Individuals to whom property is, will, or may be transferred by conveyance, will, Descent and Distribution, or statute; assignees. The term assigns is often found in deeds; for example, "heirs, administrators, and assigns to denote the assignable nature of the value of "0" to each of the variables N, A, B, and so forth. This process is called initialization in·i·tial·ize tr.v. in·i·tial·ized, in·i·tial·iz·ing, in·i·tial·iz·es Computer Science 1. To set (a starting value of a variable). 2. To prepare (a computer or a printer) for use; boot. 3. and ensures that zeroes are assigned as·sign tr.v. as·signed, as·sign·ing, as·signs 1. To set apart for a particular purpose; designate: assigned a day for the inspection. 2. as initial values each time the program is run. Without this initialization process, the variables would instead carry the last value that they held, regardless of whether it was the resulting value from a previous run of the program or from some other assignment. The program RANDNO simulates the repeated rolling of one die 120 times and then tallies TALLIES, evidence. The parts of a piece of wood out in two, which persons use to denote the quantity of goods supplied by one to the other. Poth. Obl. pt. 4, c. 1, art. 2, Sec. 7. the frequencies for 1 through 6. The simulation is handled through a WHILE loop shown in Figure 2 which, starting with N = 0 and incrementing the value of N by 1 each time through the loop, continues to roll the die and tally the results until N reaches the value of 120. The command randInt(1,6) K randomly generates an integer value from 1 to 6 (i.e., rolls a fair die) and assigns the resulting value to K Subsequently, if the number generated is equal to "1" (K=l), then the current value of A is increased by 1. If the number generated is equal to "2" (K=2), then the current value of B is increased by 1, and similarly, for the potential values 3 through 6 and their associated variables C, D, E, and F. Before students actually run the RANDNO program, it is beneficial to have them work in pairs and conduct an experiment in which a fair die with six sides labeled 1, 2,...,6 is rolled 120 times and the results tallied. As part of this experiment, students should use a stopwatch and record the amount of time required for them to complete the investigation by hand. They can then compare this time with the runtime Refers to the actual execution of a program. "At runtime" means while the program is running. See runtime library, runtime engine, runtime environment and runtime error. required for RANDNO to complete 120 rolls and provide the resulting tallies ([approximately equal to] 17 seconds). In this section of the program, the WHILE loop ends with the End statement. The statement N+1 -- N increases the value of N by 1 each time through the loop until the value of N reaches the designated value of 120 and the calculator stops the loop. The Disp statement then directs the output A, B, C, and so forth to the calculator screen. The Pause statement causes the calculator to display the values until another key is pressed. The screens in Figure 3 show the resulting values of running the program two times. In the first simulation, there were 16 rolls of "1" and in the second simulation there were 27 rolls of "1." It is a good idea to have students run the program multiple times and record the results for various simulations. Table 1 provides the results of five simulations using the RANDNO program. Students can complete the table, using the RANDNO program and simulating additional rolls. In examining the results, students should be led to consider the "reasonableness" of the numbers. This type of thinking exemplifies applications that represent one of the key competencies identified under algebraic thinking in the Principles and Standards (NCTM, 2000) document. Students would have a more thorough understanding of the generated data by answering the following questions. 1. Determine the sum of the frequencies for each of your simulations. What do you notice? 2. In your first simulation, what was the value that was rolled most frequently? Least frequently? 3. In your second simulation, what was the value that was rolled most frequently? Least frequently? 4. In looking at all the simulations, for what value of the roll did the highest frequency occur? For what value of the roll did the smallest frequency occur? 5. Did you get the same answers for questions 2-4? Were your results the same as your neighbor's results? 6. Add the values for each column in your table. What do these values represent? Compare your results for A, B, and so forth, with those of your neighbor. A MORE VISUAL APPROACH FOR DEPICTING SIMULATION RESULTS One of the most useful features of the TI-83 Plus[R] when designing these programs is its graphing capability combined with the use of the List variables. Methods for establishing the appropriate graph and the window values that allow the user to see the results of the simulation in a more visual, graphic representation are provided in Figure 4. Students should be able to construct basic graphs depicting simple probability distributions, including those like a histogram histogram or bar graph Graph using vertical or horizontal bars whose lengths indicate quantities. Along with the pie chart, the histogram is the most common format for representing statistical data. that allows students to examine the shape of a distribution of a single variable (NCTM, 2000). These activities take advantage of available calculator functions that help students better understand basic ideas of probability by requiring them to examine results both graphically and computationally com·pu·ta·tion n. 1. a. The act or process of computing. b. A method of computing. 2. The result of computing. 3. The act of operating a computer. . Figure 4 illustrates how to assign the set of possible outcomes to the list variable [L.sub.1] and their resulting frequencies to the list variable [L.sub.2] in defining the histogram. The first screen sets up a histogram plot in which the horizont al values (Xlist) being depicted de·pict tr.v. de·pict·ed, de·pict·ing, de·picts 1. To represent in a picture or sculpture. 2. To represent in words; describe. See Synonyms at represent. on the histogram represent the set of potential rolled values 1, 2 ,..., 6. These values are input into [L.sub.1] by the user as seen in the second screen. The code changes to RANDNO in Figure 5 store the simulated frequencies A, B ,..., F for the values 1, 2,..., 6 in the list variable [L.sub.2]. The command DispGraph displays the graph of the histogram previously described and defined in the Stat Graph window. The graphing window should be defined so that values for x range from 1 to 7; that is, Xmin=l and Xmax=7 with Xscl=1. With the calculator, the histogram depicts the frequency for the value "1" by a rectangular rec·tan·gu·lar adj. 1. Having the shape of a rectangle. 2. Having one or more right angles. 3. Designating a geometric coordinate system with mutually perpendicular axes. bar which runs from x=1 to x=2 with a height equal to the resulting frequency, and the frequency for the value "2" by a bar which runs from 2 to 3, and so forth. Students can experiment with assigning as·sign tr.v. as·signed, as·sign·ing, as·signs 1. To set apart for a particular purpose; designate: assigned a day for the inspection. 2. different values to Ymin and Ymax in an effort to obtain a good graph. Each histogram captured from the TI-83 Plus[R] screen provides the results of simulating the roll of the die 120 times. Given that each roll is equally likely, the expected number of times each value occurs would be 1/6 x 120, or 20 times. Setting Ymin=-10 and Ymax=40 works well for this particular simulation. With this scale, it is easy to distinguish varying frequencies from each other and to obtain a complete graph complete graph - A graph which has a link between every pair of nodes. A complete bipartite graph can be partitioned into two subsets of nodes such that each node is joined to every node in the other subset. . Th e x-axis See x-y matrix. is visible and given that there are only 120 rolls total, the maximum height of any single frequency should be below a Ymax value of 40. Figure 6 depicts two simulations using the revised RANDNO program. The revised program displays the simulation results in the form of a histogram. In addition to the visual image, these representations are also easy to compare by obtaining actual frequencies. Once the graph is depicted on the screen, it is easy to obtain the frequency for each value by using the TRACE key with the left and right arrow keys Arrow keys are buttons on a computer keyboard that move the cursor in a specified direction. They are typically located at the bottom of the keyboard to the side of the numeric keypad, usually arranged in an inverted-T layout but also found in diamond shapes. and moving to different places on the histogram. Each screen depicted here provides the frequency for a roll of "4" in each simulation. One of the nice features of using histograms is that it allows students to examine a more visual representation of the simulations. Table 2 provides results of six simulations using the histogram version of RANDNO. Students can continue the experiment by repeatedly running the simulation on their calculators and completing the table with values taken from the histograms. It is a simple process to edit To make a change to existing data. See update. (application) edit - Use of some kind of editor program to modify a document. Also used to refer to the modification itself, e.g. "my last edit only made things worse". the existing program and make small changes that allow the user to obtain quite different information. Examining the impact caused by changing the number of rolls on the outcome is an easy study to do and illustrates critical ideas about probability. By changing the WHILE statement to "N<1200," the loop that simulates the roll of the die will run for 1200 times. Given that there are six possible outcomes each with the same probability of being rolled, one would expect that the frequency for each value would be close to (116) x 1200, or 200. In the WINDOW screen, students should change the Ymax value to 400. The time required for RANDNO to run when simulating the roll of the die 1200 times is quite short ([approximately equal to] 155 seconds) when considering how long it would take to complete a similar problem by rolling the dice and recording the results by hand. If results for each simulation exactly modeled the underlying probability distribution Probability distribution A function that describes all the values a random variable can take and the probability associated with each. Also called a probability function. probability distribution , relative frequencies for each value 1, 2 ,...., 6 would be 1/6 [approximately equal to] .167. Students should examine the data as relative frequencies to get a better sense of what the values really mean for the simulations involving 120 trials versus those involving 1200 trials. The relative frequencies between outcomes varied much more for the simulations based on 120 rolls as compared to those for 1200 rolls. For example, the minimum frequency for n=120 was 12, giving a relative frequency of 12/120 =.10 and the maximum frequency occurring was 30, giving a relative frequency of 30/120=.25. When examining data for n=1200 in Table 3, the minimum frequency was 182 with a relative frequency of 182/1200 [approximately equal to].15 and a maximum frequency of 219 with a relative frequency of 219/1200 [approximately equal to].18. Due to less variation in the frequencies, students should observe that the histograms depicting the results from 1200 rolls illustrated by those in Figure 7 tend to be much more level than those for 120 rolls. When the results are those of 1200 rolls, the histogram depicts a distribution closer to the underlying probability distribution in which each roll is equally likely. The difference in outcomes for N=1200 as compared to N=120 illustrates nicely one of the basic properties of simulations. Precision in estimating actual probabilities increases as the number of repetitions increases (Moore Moore, city (1990 pop. 40,761), Cleveland co., central Okla., a suburb of Oklahoma City; inc. 1887. Its manufactures include lightning- and surge-protection equipment, packaging for foods, and auto parts. , 1991). SIMULATIONS THAT MODEL THE ROLL OF A PAIR OF DICE It is important that students are able to generate simple probability distributions and describe specific events in terms of their likelihood of occurring. Students can study the probabilities associated with rolling a pair of dice easily by determining theoretical probabilities from finding the sample space and by deriving de·rive v. de·rived, de·riv·ing, de·rives v.tr. 1. To obtain or receive from a source. 2. empirical probabilities from simulations using slight variations in the RANDNO program. According to according to prep. 1. As stated or indicated by; on the authority of: according to historians. 2. In keeping with: according to instructions. 3. the Reasoning and Proof Standards, students should have experience in making and investigating mathematical conjectures (NCTM, 2000). Before students study the sample space as depicted in Table 4, it is worthwhile for students to try to estimate the probabilities for the outcomes 2, 3,..., 12 when repeatedly rolling a pair of dice. After estimating these probabilities, students should determine the theoretical probabilities using Table 4 for each of the potential rolls of 2, 3,..., 12. For instance the probability of rolling a 2 is 1/36 and the probability of rolling a 7 is 6/36=1/6. Students should be led to identify the symmetry symmetry, generally speaking, a balance or correspondence between various parts of an object; the term symmetry is used both in the arts and in the sciences. in the distribution; that is, P(2) = P(12) = 1/36 P(3) = P(11) = 2/36 P(4) = P(10) = 3/36 P(5) = P(9) = 4/36 P(6) = P(8) 5/36 P(7) = 6/36. From their prior work with calculator programming, students are able to make the few changes to RANDNO necessary to model the roll of a pair of dice rather than the roll of a single die. More variables are required for tallying the results since there are more possible rolled values. In simulating each roll of a pair of dice, students often try the command randInt (2,12). It is usually not long before they realize that this command is in error, particularly as they are encouraged to examine the histogram. With the command randInt (2,12), the resulting distribution is one in which each sum 2, 3, ... ,12 is equally likely as opposed op·pose v. op·posed, op·pos·ing, op·pos·es v.tr. 1. To be in contention or conflict with: oppose the enemy force. 2. to the actual distribution that they are trying to model. The distribution for a large number of rolls should reflect the fact that P(7)>P(6), P(7)>P(8), P(6)>P(5), and so on. The program TWODICE provided in the Appendix is a slight revision of the program RANDNO that correctly simulates rolling a pair of fair dice and can be used to determine empirical em·pir·i·cal adj. 1. Relying on or derived from observation or experiment. 2. Verifiable or provable by means of observation or experiment. 3. data for determining these pr obabilities. Students can examine the impact of simulating more rolls on the accuracy of the resulting histogram in depicting the theoretical distribution. Understanding the effects of the number of trials during a given experiment on the results is a critical concept related to the study of randomness and probability. The first screen in Figure 8 illustrates results for 110 rolls, the second screen shows results for 440 rolls, and the last screen results for 4400 rolls. As the number of rolls is increased, the resulting histogram takes on more of the shape of the underlying distribution. Students should begin to notice the symmetry as the total number of rolls increases. With 110 rolls, the histogram reflects no symmetry with the highest frequencies belonging to "6" and "10." With 440 rolls, the highest frequency belongs to "8" followed closely by "7." The graph seems to be more reflective Refers to light hitting an opaque surface such as a printed page or mirror and bouncing back. See reflective media and reflective LCD. of the expected distribution than for 110 rolls. The last histogram with 4400 rolls depicts much more closely the theoretical distribution with the largest frequency belonging to "7." The last graph also appears much more symmetrical symmetrical equally on both sides. symmetrical multifocal encephalopathy inherited disease in two forms: Limousin form appears at about a month old with blindness, forelimb hypermetria, hyperesthesia, nystagmus, aggression, weight . CONCLUSION As shown through these programming activities, students need to learn only a few basic commands in calculator programming to have the potential for examining multiple ideas in mathematics. The TI-83 Plus[R] calculator easily combines programming capabilities with its graphing features, providing easy access to visual representations as well as computational results for studying ideas like those in probability discussed here. Programming the calculator to do these simulations requires students to learn programming fundamentals such as logic, coding, and looping. As such, this calculator simulation exercise provides an excellent foundation for students who later are engaged in higher-level computer programming such as that in a personal computer and mainframe environment. APPENDIX :0 N :0 A :0 B :0 C :0 D :0 E :0 F :0 G :0 H :0 I :0 J :0 K :0 R :While N<4400 :randlnt(1,6)+randlnt(1,6) R :If R=2 :A+1 A :If R=3 :B+1 B :If R=4 :C+1 C :If R=5 :D+1 D :If R=6 :E+1 E :If R=7 :F+1 F :If R=8 :G+1 G :IF R=9 :H+1 H :If R=10 :l+1 I :If R=11 :J+1 J :If R=12 :K+1 K :N+1 N :End :(A,B,C,D,E,F,G,H,I,J,K} [L.sub.2] :Disp A,B,C,D,E,F :Pause :Disp G,H,I,J,K :Pause :DispGraph :Stop [FIGURE 6 OMITTED] [FIGURE 7 OMITTED] [FIGURE 8 OMITTED] Table 1 Results of Running the Initial Version of RANDNO Five Times Die Frequency Sim 1 16 20 27 19 21 17 Sim 2 27 20 17 18 17 21 Sim 3 13 17 30 21 23 16 Sim 4 22 15 22 19 28 14 Sim 5 18 20 19 22 19 22 Sim 6 Sim 7 Sim 8 Sim 9 Sim 10 Table 2 Results of Running the Histogram Version of RANDO Six Times Die Frequency Sim 1 12 23 20 14 23 28 Sim 2 17 22 20 27 22 12 Sim 3 22 15 20 23 23 17 Sim 4 22 20 19 20 22 17 Sim 5 20 19 21 20 16 24 Sim 6 14 26 16 21 23 20 Sim 7 Sim 8 Sim 9 Sim 10 Table 3 Results of RANDNO for Which Each Simulation Requires 1200 Rolls Die Frequency Sim 1 190 205 193 200 201 211 Sim 2 197 177 198 210 210 208 Sim 3 204 213 200 182 207 194 Sim 4 192 186 214 202 193 213 Sim 5 189 219 213 183 191 205 Sim 6 Sim 7 Sim 8 Sim 9 Sim 10 Table 4 Sample Space for Rolling Pair of Dice 2 3 4 5 6 7 3 4 5 6 7 8 4 5 6 7 8 9 5 6 7 8 9 10 6 7 8 9 10 11 7 8 9 10 11 12 References Moore, David S. (1991). Statistics: Concepts and controversies. New York New York, state, United States New York, Middle Atlantic state of the United States. It is bordered by Vermont, Massachusetts, Connecticut, and the Atlantic Ocean (E), New Jersey and Pennsylvania (S), Lakes Erie and Ontario and the Canadian province of : W.H. Freeman Freeman can mean:
National Council of Teachers of Mathematics (NCTM) (2000). Principles and standards for school mathematics. Reston Reston, uninc. city (1990 pop. 48,556), Fairfax co., N Va., a planned community established in 1961. A suburb of Washington, D.C., Reston is organized in a series of residential villages and commercial areas. , VA: Author. |
|
||||||||||||||||||

-ev
Printer friendly
Cite/link
Email
Feedback
Reader Opinion