// LabCardDrawSpecs.swift. 3/23/2020. import Foundation class LabCoinTossSpecs { let strCardDrawRandomVblSpecs :String = """ `` Lab Specs xxxx yyyy // 0: Specify item 0 xxxx yyyy // 1: Specify item 1 `` Prob Specs ` Problem 0 Start Screen 1 - Random Variable: Relative Frequency and Probability // 0: Title 7 9 10 12 // 1: Initial selected cards //2_of_Clubs 3_of_Hearts 3_of_Diamonds 4_of_Spades // 1: Initial selected cards ` Text Start // 2: Text Objective: Illustrate the relative frequency interpretation of probability. That is, show that after many, many repetitions of the experiment, the distribution of the random variable's numerical values mirrors the probability distribution of the random variable. Scroll down the list of cards to see that four cards in the deck are selected: 2 of Clubs, 3 of Hearts, 3 of Diamonds, and 4 of Spades. Experiment: Draw one card from a deck and then replace it. The list in the upper left corner of the window indicates the cards that are in the deck. Be certain that the 2 of Clubs, 3 of Hearts, 3 of Diamonds, and 4 of Hearts are selected. Let v equal the "value" of the card drawn; that is, v equals 2 if the 2 of Clubs is drawn, 3 if the 3 of Hearts or the 3 of Diamonds is drawn, and 4 if the 4 of Hearts is drawn. 1. What is the probability that v would equal each of its possible values (2, 3, and 4) for a single repetition the experiment? Note that the Pause checkbox is checked. Consequently, the simulation will pause after each repetition. 2. Click the Start button. Which card was drawn from the deck? What does numerical value of v equal on the first repetition of the experiment? 3. Click the Next button to repeat the experiment for a second time. What does numerical value of v equal on the second repetition of the experiment? Click the Next button a few more times. What does the numerical value of v equal for each repetition of the experiment? Explain why v is a random variable. The histogram seen above illustrates the distribution of the numerical values of the v's visually; Clear the Pause checkbox. Now, the simulation will no longer pause after each repetition of the experiment. 4. Click the Next button. After many, many repetitions click the Stop button. What are the relative frequencies of the numerical values of the v's after many, many repetitions? 5. Compare your answers to 1 and 4; that is, compare the probabilities and the relative frequencies. How is the probability distribution related to the distribution of the numerical values after many, many repetitions? ` Prob End ` Problem 1 Start Screen 2 - Random Variable: Mean And Variance // 0: Title 7 9 10 12 // 1: Initial selected cards ` Text Start // 2: Text Objective: Illustrate the relative frequency interpretation of probability by focusing on the distribution's mean (center) and variance (spread). That is, show that after many, many repetitions of the experiment, the mean and variance of the random variable's numerical values mirrors the mean and variance of the random variable's probability distribution. Scroll down the list of cards to see that four cards in the deck are selected: 2 of Clubs, 3 of Hearts, 3 of Diamonds, and 4 of Spades. Experiment: Draw one card from a deck and then replace it. The list in the upper left corner of the window indicates the cards that are in the deck. Be certain that the 2 of Clubs, 3 of Hearts, 3 of Diamonds, and 4 of Hearts are selected.Next Let v equal the "value" of the card drawn; that is, v equals 2 if the 2 of Clubs is drawn, 3 if the 3 of Hearts or the 3 of Diamonds is drawn, and 4 if the 4 of Hearts is drawn. 1. Using the appropriate equations, calculate the mean and variance of the the random variable v's probability distribution? 2. Click the Start button. Which card was drawn from the deck? What does numerical value of v equal on the first repetition of the experiment? 3. Click the Next button to repeat the experiment for a second time. What does numerical value of v equal on the second repetition of the experiment? Calculate the mean and variance of the numerical values for the first two repetitions. Compare the simulation's calculations of the mean and variance with your calculations. Click the Next button a few more times until you are convinced that the simulation is calculating the mean and variance of the numerical values correctly. Clear the Pause checkbox. 4. Click the Next button. After many, many repetitions click the Stop button. What are mean and variance of the numerical values v's after many, many repetitions? 5. Compare your answers to 1 and 4. How is the mean of the probability distribution related to the mean of the numerical values after many, many repetitions? How is the variance of the probability distribution related to the variance of the numerical values after many, many repetitions? ` Prob End """ }