Project Part 1 Objective Our objective, in this Part 1 of our Project, is to practise solving a problem by composing and testing a Python program using all that we have learnt so far and discovering new things, such as lists of lists, on the way. Project – Hunting worms in our garden! No more turtles! In this project, we shall move on to worms. Indeed, our project is a game in which the player hunts for worms in our garden. Once our garden has been displayed, the player tries to guess where the worms are located by entering the coordinates of a cell in our garden. When the player has located all the worms, the game is over! Of course there are ways of making this game more exciting (hence complicated), but considering that we have 2 weeks for Part 1 and 2 weeks for Part 2, keeping it simple will be our goal. We will implement our game in two parts. In Part 1, we write code that constructs and tests our data structures i.e., our variables. In Part 2, we write code that allows the player to play a complete “worm hunting” game! ? Project – Part 1 – Description Data Structures (variables): As stated above, in Part 1, we write code that constructs our data structures i.e., our variables. In our game program, we will need data structures (variables) to represent: 1. Our garden that is displayed to the player (suggestion: list of lists), 2. The garden that contains all the worms (suggestion: another list of lists), Garden: Our garden in Part 1 of our Project will have a width and a height of 10. Warning: The width and the height of our garden may change in Part 2 of our Project. So, it may be a good idea to create 2 variables and assign the width and the height of our garden to these 2 variables. 3. Our worms and their information. For each worm, we may want to keep the following information: a. worm number, b. the location of the worm, for example, either the coordinates of the cells containing the worm OR the coordinate of the first cell containing the worm, its length and whether the worm is laying horizontally or vertically. Worms: We will create 6 worms of length 3. 4. And other variables as needed. Testing our data structures: ? Suggestion: as we create a data structure (the “displayed” garden, the garden containing the worms, each worm, etc…), print it with a “debug print statement”. Once we are certain the data structure is well constructed, comment out the “debug print statement”. Code: In Part 1, the code we write must include functions and it must include the main section of our program. In other words, in Part 1, the code we write must be a complete program. In terms of functions, here is a list of suggestions. We may have functions that … ? creates a garden (i.e., a garden data structure), ? creates the worms (i.e., the worm data structure), ? places a worm in the garden that is to hold the worms (i.e., another garden data structure), ? displays the garden on the screen for the player to see, ? displays a worm in the displayed garden, ? etc… ? Finally, in Part 1, the code we write must implement the following algorithm: Algorithm: Here is the algorithm for the main section of our game program: ? Welcome the player ? Create an empty “displayed” garden, (“displayed” because this is the garden we display to the player) ? Create the worms (worms’ information) ? Create an empty “hidden” garden Note 1: “hidden” because one can keep track of the worms in this “hidden” garden, which we do not show to the player. This is why it is called “hidden”. Note 2: One can keep track of worm’s locations using a different mechanism or data structure. It does not have to be a list of lists representing a “hidden” garden. We are free to choose how we want to keep track of where our worms are located in our garden. ? Place each worm in the “hidden” garden (or whatever mechanism or data structure we decide to use) ? Display the “displayed” garden on the screen for the player to see ? While the player wants to play, ask the player for a worm number (1 to 6), read this worm number and display this worm on the “displayed” garden. This is not the game. Remember, we shall implement the game itself in Part 2. Here, in this step, we make sure our code works properly, i.e., it can retrieve worm information and display worms properly. Displaying worms properly: Note that when we create worms and display them, it may be the case that worms overlap with other worms and that worms wrap around the garden. These 2 situations are illustrated in the 3 Sample Runs discussed below. At this point, we are ready for Part 2 of our Project. Sample Runs: In order to illustrate the explanations given above of what we are to do in this Part 1 of our Project, 3 sample runs have been posted below the description of this Part 1 of our Project on our course web site. Have a look at these 3 sample runs. The code we create for this Part 1 of our Project must produce exactly the same output as the one shown in these 3 sample runs. Of course, the position of our worms will be different but everything else should be the same. What we see in each of these 3 sample runs is 1 execution of the code we are to create for this Part 1 of our Project. Note about Sample Run 1: In this Sample Run, the player enters the numbers 1 to 8 sequentially. Wrap around: Worm 2 wraps around: it starts at (row 7, column B), (row 7, column A) then wraps around to (row 7, column J). Worm 6 also wraps around: it starts at (row 2, column E), (row 1, column E) then wraps around to (row 10, column E). Overlap: There are some overlapping worms: worms 5 and 6 overlap at (row 1, column E). Note about Sample Run 2: In this Sample Run, the player enters the numbers 1 to 8 sequentially. Wrap around: Worm 3 wraps around: it starts at (row 1, column B) then wraps around to (row 10, column B) and (row 9, column B). Worm 6 also wraps around: it starts at (row 1, column D) then wraps around to (row 10, column D) and (row 9, column D). Overlap: There are some overlapping worms: worms 2 and 4 overlap at (row 3, column H), worms 1 and 2 overlap at (row 3, column G) and worms 2 and 5 overlap at (row 3, column E). Note about Sample Run 3: In this Sample Run, the player enters the numbers in the following sequence: 3, 2, 6, 4, 5, 1, 7, 8. Wrap around: Worm 3 wraps around: it starts at (row 2, column C), (row 1, column C) then wraps around to (row 10, column C). Worm 1 also wraps around: it starts at (row 2, column B), (row 2, column A) then wraps around to (row 2, column J). Overlap: There are some overlapping worms: worms 6 and 3 overlap at (row 1, column C) and (row 2, column C). Other Requirements: Here are a few more requirements the code we are to create for this Part 1 of our Project must satisfy. 1. The location of each worm in the garden must be determined randomly. 2. Whether a worm is lying horizontally or vertically must also be determined randomly. 3. It is acceptable in Part 1 of our Project if worms overlap each other (see Sample Runs) 4. When placing a worm in a garden, the worm must “wrap around” the garden. See Sample Runs for examples of what “wrapping around” signifies. How will we implement this wrapping around? Hint: wrapping around can be achieved using an arithmetic operator we have already seen. 5. We must make use of docstring when we implement our functions (have a look at our textbook for an explanation and an example). 6. Every time we encounter the word must in this description of Part 1 of our Project, we shall look upon that sentence as another requirement. For example, the sentence “The code we create for this Part 1 of our Project must produce exactly the same output as the one shown in these 3 sample runs.”, even though it is not listed below the Other Requirements heading, is also a requirement because of its must.

Project Part 1 Objective Our objective, in this Part 1 of our Project, is to practise solving a problem by composing and testing a Python program using all that we have learnt so far and discovering new things, such as lists of lists, on the way. Project – Hunting worms in our garden! No more turtles! In this project, we shall move on to worms. Indeed, our project is a game in which the player hunts for worms in our garden. Once our garden has been displayed, the player tries to guess where the worms are located by entering the coordinates of a cell in our garden. When the player has located all the worms, the game is over! Of course there are ways of making this game more exciting (hence complicated), but considering that we have 2 weeks for Part 1 and 2 weeks for Part 2, keeping it simple will be our goal. We will implement our game in two parts. In Part 1, we write code that constructs and tests our data structures i.e., our variables. In Part 2, we write code that allows the player to play a complete “worm hunting” game! ? Project – Part 1 – Description Data Structures (variables): As stated above, in Part 1, we write code that constructs our data structures i.e., our variables. In our game program, we will need data structures (variables) to represent: 1. Our garden that is displayed to the player (suggestion: list of lists), 2. The garden that contains all the worms (suggestion: another list of lists), Garden: Our garden in Part 1 of our Project will have a width and a height of 10. Warning: The width and the height of our garden may change in Part 2 of our Project. So, it may be a good idea to create 2 variables and assign the width and the height of our garden to these 2 variables. 3. Our worms and their information. For each worm, we may want to keep the following information: a. worm number, b. the location of the worm, for example, either the coordinates of the cells containing the worm OR the coordinate of the first cell containing the worm, its length and whether the worm is laying horizontally or vertically. Worms: We will create 6 worms of length 3. 4. And other variables as needed. Testing our data structures: ? Suggestion: as we create a data structure (the “displayed” garden, the garden containing the worms, each worm, etc…), print it with a “debug print statement”. Once we are certain the data structure is well constructed, comment out the “debug print statement”. Code: In Part 1, the code we write must include functions and it must include the main section of our program. In other words, in Part 1, the code we write must be a complete program. In terms of functions, here is a list of suggestions. We may have functions that … ? creates a garden (i.e., a garden data structure), ? creates the worms (i.e., the worm data structure), ? places a worm in the garden that is to hold the worms (i.e., another garden data structure), ? displays the garden on the screen for the player to see, ? displays a worm in the displayed garden, ? etc… ? Finally, in Part 1, the code we write must implement the following algorithm: Algorithm: Here is the algorithm for the main section of our game program: ? Welcome the player ? Create an empty “displayed” garden, (“displayed” because this is the garden we display to the player) ? Create the worms (worms’ information) ? Create an empty “hidden” garden Note 1: “hidden” because one can keep track of the worms in this “hidden” garden, which we do not show to the player. This is why it is called “hidden”. Note 2: One can keep track of worm’s locations using a different mechanism or data structure. It does not have to be a list of lists representing a “hidden” garden. We are free to choose how we want to keep track of where our worms are located in our garden. ? Place each worm in the “hidden” garden (or whatever mechanism or data structure we decide to use) ? Display the “displayed” garden on the screen for the player to see ? While the player wants to play, ask the player for a worm number (1 to 6), read this worm number and display this worm on the “displayed” garden. This is not the game. Remember, we shall implement the game itself in Part 2. Here, in this step, we make sure our code works properly, i.e., it can retrieve worm information and display worms properly. Displaying worms properly: Note that when we create worms and display them, it may be the case that worms overlap with other worms and that worms wrap around the garden. These 2 situations are illustrated in the 3 Sample Runs discussed below. At this point, we are ready for Part 2 of our Project. Sample Runs: In order to illustrate the explanations given above of what we are to do in this Part 1 of our Project, 3 sample runs have been posted below the description of this Part 1 of our Project on our course web site. Have a look at these 3 sample runs. The code we create for this Part 1 of our Project must produce exactly the same output as the one shown in these 3 sample runs. Of course, the position of our worms will be different but everything else should be the same. What we see in each of these 3 sample runs is 1 execution of the code we are to create for this Part 1 of our Project. Note about Sample Run 1: In this Sample Run, the player enters the numbers 1 to 8 sequentially. Wrap around: Worm 2 wraps around: it starts at (row 7, column B), (row 7, column A) then wraps around to (row 7, column J). Worm 6 also wraps around: it starts at (row 2, column E), (row 1, column E) then wraps around to (row 10, column E). Overlap: There are some overlapping worms: worms 5 and 6 overlap at (row 1, column E). Note about Sample Run 2: In this Sample Run, the player enters the numbers 1 to 8 sequentially. Wrap around: Worm 3 wraps around: it starts at (row 1, column B) then wraps around to (row 10, column B) and (row 9, column B). Worm 6 also wraps around: it starts at (row 1, column D) then wraps around to (row 10, column D) and (row 9, column D). Overlap: There are some overlapping worms: worms 2 and 4 overlap at (row 3, column H), worms 1 and 2 overlap at (row 3, column G) and worms 2 and 5 overlap at (row 3, column E). Note about Sample Run 3: In this Sample Run, the player enters the numbers in the following sequence: 3, 2, 6, 4, 5, 1, 7, 8. Wrap around: Worm 3 wraps around: it starts at (row 2, column C), (row 1, column C) then wraps around to (row 10, column C). Worm 1 also wraps around: it starts at (row 2, column B), (row 2, column A) then wraps around to (row 2, column J). Overlap: There are some overlapping worms: worms 6 and 3 overlap at (row 1, column C) and (row 2, column C). Other Requirements: Here are a few more requirements the code we are to create for this Part 1 of our Project must satisfy. 1. The location of each worm in the garden must be determined randomly. 2. Whether a worm is lying horizontally or vertically must also be determined randomly. 3. It is acceptable in Part 1 of our Project if worms overlap each other (see Sample Runs) 4. When placing a worm in a garden, the worm must “wrap around” the garden. See Sample Runs for examples of what “wrapping around” signifies. How will we implement this wrapping around? Hint: wrapping around can be achieved using an arithmetic operator we have already seen. 5. We must make use of docstring when we implement our functions (have a look at our textbook for an explanation and an example). 6. Every time we encounter the word must in this description of Part 1 of our Project, we shall look upon that sentence as another requirement. For example, the sentence “The code we create for this Part 1 of our Project must produce exactly the same output as the one shown in these 3 sample runs.”, even though it is not listed below the Other Requirements heading, is also a requirement because of its must.

info@checkyourstudy.com
Which of the following parts of a plant seed turns into the root system? Select one: a. cotyledon b. epicotyl c. hypocotyl d. radicle The radicle is responsible for root development.

Which of the following parts of a plant seed turns into the root system? Select one: a. cotyledon b. epicotyl c. hypocotyl d. radicle The radicle is responsible for root development.

Question 1 In order to properly manage expenses, the company investigates the amount of money spent by its sales office. The below numbers are related to six randomly selected receipts provided by the staff. \$147 \$124 \$93 \$158 \$164 \$171 a) Calculate ̅ , s2 and s for the expense data. b) Assume that the distribution of expenses is approximately normally distributed. Calculate estimates of tolerance intervals containing 68.26 percent, 95.44 percent, and 99.73 percent of all expenses by the sales office. c) If a member of the sales office submits a receipt with the amount of \$190, should this expense be considered unusually high? Explain your answer. d) Compute and interpret the z-score for each of the six expenses. Question 2 A survey presents the results of a concept study for the taste of new food. Three hundred consumers between 18 and 49 years old were randomly selected. After sampling the new cuisine, each was asked to rate the quality of food. The rating was made on a scale from 1 to 5, with 5 representing “extremely agree with the quality” and with 1 representing “not at all agree with the new food.” The results obtained are given in Table 1. Estimate the probability that a randomly selected 18- to 49-year-old consumer a) Would give the phrase a rating of 4. b) Would give the phrase a rating of 3 or higher. c) Is in the 18–26 age group; the 27–35 age group; the 36–49 age group. d) Is a male who gives the phrase a rating of 5. e) Is a 36- to 49-year-old who gives the phrase a rating of 2. f) Estimate the probability that a randomly selected 18- to 49-year-old consumer is a 27- to 49-year-old who gives the phrase a rating of 3. g) Estimate the probability that a randomly selected 18- to 49-year-old consumer would 1) give the phrase a rating of 2 or 4 given that the consumer is male; 2) give the phrase a rating of 4 or 5 given that the consumer is female. Based on the results of parts 1 and 2, is the appeal of the phrase among males much different from the appeal of the phrase among females? Explain. h) Give the phrase a rating of 4 or 5, 1) given that the consumer is in the 18–26 age group; 2) given that the consumer is in the 27–35 age group; 3) given that the consumer is in the 36–49 age group. Table 1. Gender Age Group Rating Total Male Female 18-26 27-35 36-49 Extremely Appealing (5) 151 68 83 48 66 37 (4) 91 51 40 36 36 19 (3) 36 21 15 9 12 15 (2) 13 7 6 4 6 3 Not at all appealing(1) 9 3 6 4 3 2 Question 3 Based on the reports provided by the brokers, it is concluded that the annual returns on common stocks are approximately normally distributed with a mean of 17.8 percent and a standard deviation of 29.3 percent. On the other hand, the company reports that the annual returns on tax-free municipal bonds are approximately normally distributed with a mean return of 4.7 percent and a standard deviation of 10.2 percent. Find the probability that a randomly selected a) Common stock will give a positive yearly return. b) Tax-free municipal bond will give a positive yearly return. c) Common stock will give more than a 13 percent return. d) Tax-free municipal bond will give more than a 11.5 percent return. e) Common stock will give a loss of at least 7 percent. f) Tax-free municipal bond will give a loss of at least 10 percent. Question 4 Based on a sample of 176 workers, it is estimated that the mean amount of paid time lost during a three-month period was 1.4 days per employee with a standard deviation of 1.3 days. It is also estimated that the mean amount of unpaid time lost during a three-month period was 1.0 day per employee with a standard deviation of 1.8 days. We randomly select a sample of 100 workers. a) What is the probability that the average amount of paid time lost during a three-month period for the 100 blue-collar workers will exceed 1.5 days? Assume σ equals 1.3 days. b) What is the probability that the average amount of unpaid time lost during a three-month period for the 100 workers will exceed 1.5 days? Assume σ equals 1.8 days. c) A sample of 100 workers is randomly selected. Suppose the sample mean amount of unpaid time lost during a three-month period actually exceeds 1.5 days. Would it be reasonable to conclude that the mean amount of unpaid time lost has increased above the previously estimated 1.0 day? Explain. Assume σ still equals 1.8 days.

Question 1 In order to properly manage expenses, the company investigates the amount of money spent by its sales office. The below numbers are related to six randomly selected receipts provided by the staff. \$147 \$124 \$93 \$158 \$164 \$171 a) Calculate ̅ , s2 and s for the expense data. b) Assume that the distribution of expenses is approximately normally distributed. Calculate estimates of tolerance intervals containing 68.26 percent, 95.44 percent, and 99.73 percent of all expenses by the sales office. c) If a member of the sales office submits a receipt with the amount of \$190, should this expense be considered unusually high? Explain your answer. d) Compute and interpret the z-score for each of the six expenses. Question 2 A survey presents the results of a concept study for the taste of new food. Three hundred consumers between 18 and 49 years old were randomly selected. After sampling the new cuisine, each was asked to rate the quality of food. The rating was made on a scale from 1 to 5, with 5 representing “extremely agree with the quality” and with 1 representing “not at all agree with the new food.” The results obtained are given in Table 1. Estimate the probability that a randomly selected 18- to 49-year-old consumer a) Would give the phrase a rating of 4. b) Would give the phrase a rating of 3 or higher. c) Is in the 18–26 age group; the 27–35 age group; the 36–49 age group. d) Is a male who gives the phrase a rating of 5. e) Is a 36- to 49-year-old who gives the phrase a rating of 2. f) Estimate the probability that a randomly selected 18- to 49-year-old consumer is a 27- to 49-year-old who gives the phrase a rating of 3. g) Estimate the probability that a randomly selected 18- to 49-year-old consumer would 1) give the phrase a rating of 2 or 4 given that the consumer is male; 2) give the phrase a rating of 4 or 5 given that the consumer is female. Based on the results of parts 1 and 2, is the appeal of the phrase among males much different from the appeal of the phrase among females? Explain. h) Give the phrase a rating of 4 or 5, 1) given that the consumer is in the 18–26 age group; 2) given that the consumer is in the 27–35 age group; 3) given that the consumer is in the 36–49 age group. Table 1. Gender Age Group Rating Total Male Female 18-26 27-35 36-49 Extremely Appealing (5) 151 68 83 48 66 37 (4) 91 51 40 36 36 19 (3) 36 21 15 9 12 15 (2) 13 7 6 4 6 3 Not at all appealing(1) 9 3 6 4 3 2 Question 3 Based on the reports provided by the brokers, it is concluded that the annual returns on common stocks are approximately normally distributed with a mean of 17.8 percent and a standard deviation of 29.3 percent. On the other hand, the company reports that the annual returns on tax-free municipal bonds are approximately normally distributed with a mean return of 4.7 percent and a standard deviation of 10.2 percent. Find the probability that a randomly selected a) Common stock will give a positive yearly return. b) Tax-free municipal bond will give a positive yearly return. c) Common stock will give more than a 13 percent return. d) Tax-free municipal bond will give more than a 11.5 percent return. e) Common stock will give a loss of at least 7 percent. f) Tax-free municipal bond will give a loss of at least 10 percent. Question 4 Based on a sample of 176 workers, it is estimated that the mean amount of paid time lost during a three-month period was 1.4 days per employee with a standard deviation of 1.3 days. It is also estimated that the mean amount of unpaid time lost during a three-month period was 1.0 day per employee with a standard deviation of 1.8 days. We randomly select a sample of 100 workers. a) What is the probability that the average amount of paid time lost during a three-month period for the 100 blue-collar workers will exceed 1.5 days? Assume σ equals 1.3 days. b) What is the probability that the average amount of unpaid time lost during a three-month period for the 100 workers will exceed 1.5 days? Assume σ equals 1.8 days. c) A sample of 100 workers is randomly selected. Suppose the sample mean amount of unpaid time lost during a three-month period actually exceeds 1.5 days. Would it be reasonable to conclude that the mean amount of unpaid time lost has increased above the previously estimated 1.0 day? Explain. Assume σ still equals 1.8 days.

info@checkyourstudy.com