Question no Assignment 2 1 30.0333333 degrees 2 342.111389 degrees … Read More...
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
A company purchased \$1,800 of merchandise on December 5. On December 7, it returned \$200 worth of merchandise. On December 8, it paid the balance in full, taking a 2% discount. The amount of the cash paid on December 8 equals:

## A company purchased \$1,800 of merchandise on December 5. On December 7, it returned \$200 worth of merchandise. On December 8, it paid the balance in full, taking a 2% discount. The amount of the cash paid on December 8 equals:

Question 19   A company purchased \$1,800 of merchandise on … Read More...
Homework #8  Consider the veracity or falsehood of each of the following statements. For bonus, argue for those that you believe are true while providing a counterexample for those that you believe are false.  If the first and third rows of A are equal, then det A 0.  If P is a projection, then uCP if and only if Pu  u.  If P is a projection, and detP  0, then P  I .  If A has determinant 10, then 1 A has determinant 1 10 .  If B is invertible, 1 1 det(A B ) det A (detB) .  If P is a projection, and R  2P I , then 2 R  I .  If P is a projection, and P  I , then detP  0 .  Short Computations. All of the following do not involve long computations:  Suppose 1 2 1 5 1 8 A                  and 1 9 2 4 3 1 A                   . Compute 7 13 19 A         .  Compute               0 8 7 1 0 2 3 4 5 3 0 9 2 0 0 0 3 0 0 0 1 9 3 2 0 det .  Use Cramer’s Rule to find 5 x (hint: you do not need your calculator). 1 2 3 4 5 5x 2x 8x x 3x 13 1 3 3x 5x 0 1 3 5 3x 3x 3x 9 1 2 3 5 3x 2x x 2x 7 1 3 x 4x 0 Let A 1 2 3 4 1 3 4 6 2 5 13 15 4 10 15 31 . Given is that det A  61. Do the following:  1 1 2 4 2 3 5 10 3 4 13 15 4 6 15 31 det  det2A  1 3 4 6 2 4 6 8 2 5 13 15 4 10 15 31 det  1 3 4 6 2 5 13 15 4 10 15 31 1 2 3 4 det  Consider the matrix A  0 1 0 0 0 0 1 0 0 0 0 1 1 2 2 1           . Use row (or column) expansion to compute det(xI A) .  The matrix 4 1 1 2 1 1 1 4 1 1 2 1 1 1 4 1 1 2 2 1 1 4 1 1 1 2 1 1 4 1 1 1 2 1 1 4 1 6 P is the projection matrix for the column space of matrix A. This matrix A is also known to be of full rank. Answer the following, giving reasons for your answers.  Find a transparent basis and the dimension for the column space of P.  Find a basis and the dimension for the column space of A .  What size is the matrix A ?  Find a transparent basis and the dimension for the null space of P.  Find a transparent basis and the dimension for the row space of P.  Find a basis and the dimension for the null space of A.  For which of the following b can you find a solution to the system Ax b ? This does not mean you should find a solution, only whether one could or not. 10 17 19 14 10 17 19 14 13 10 17 19 14 13 23 1 1 1 1 1 1 .  It is known that certain vector u is a solution to the system Ax c . Give all solutions to Ax c .  It is also known that 1 2 3 4 5 6 Ax does not have a solution. How would you change the constant vector so that there would be a solution? Extra Problems.  Fill in the blank with the best possible expression to complete the sentence truthfully. Only that one will be counted correct. 1. matrix with two equal columns will have zero determinant. 1 2 3 Some Every No 2. If A is invertible, then A commute with its inverse. 1 2 3 must always can will not 3. If A is 6  9 , then the columns of A be linearly independent. While in AT , the columns be linearly independent. 1 2 3 can have to cannot 4. Let A be square, and suppose Ax  0 has a nontrivial solution. Then detA equal 0. 1 2 3 may cannot must 5. Let A and B be 3 3. Then det (AB) equal det(A)det(B) . 1 2 3 could must couldn’t 6. Let A be square and suppose detA  0. Then have an inverse 1 2 3 will not may must always 7. Let A and B be 2  2 . Then det (A B) equal det(A)  det(B) . 1 2 3 could must could not 8. exist a 6  6 matrix all of whose entries are whole numbers and its determinant is 2 5 . 1 2 3 There does There does not There might Bonus: Consider the matrix 0 0 1 0 2 0 n 0 . Give its determinant as a function of n.

## Homework #8  Consider the veracity or falsehood of each of the following statements. For bonus, argue for those that you believe are true while providing a counterexample for those that you believe are false.  If the first and third rows of A are equal, then det A 0.  If P is a projection, then uCP if and only if Pu  u.  If P is a projection, and detP  0, then P  I .  If A has determinant 10, then 1 A has determinant 1 10 .  If B is invertible, 1 1 det(A B ) det A (detB) .  If P is a projection, and R  2P I , then 2 R  I .  If P is a projection, and P  I , then detP  0 .  Short Computations. All of the following do not involve long computations:  Suppose 1 2 1 5 1 8 A                  and 1 9 2 4 3 1 A                   . Compute 7 13 19 A         .  Compute               0 8 7 1 0 2 3 4 5 3 0 9 2 0 0 0 3 0 0 0 1 9 3 2 0 det .  Use Cramer’s Rule to find 5 x (hint: you do not need your calculator). 1 2 3 4 5 5x 2x 8x x 3x 13 1 3 3x 5x 0 1 3 5 3x 3x 3x 9 1 2 3 5 3x 2x x 2x 7 1 3 x 4x 0 Let A 1 2 3 4 1 3 4 6 2 5 13 15 4 10 15 31 . Given is that det A  61. Do the following:  1 1 2 4 2 3 5 10 3 4 13 15 4 6 15 31 det  det2A  1 3 4 6 2 4 6 8 2 5 13 15 4 10 15 31 det  1 3 4 6 2 5 13 15 4 10 15 31 1 2 3 4 det  Consider the matrix A  0 1 0 0 0 0 1 0 0 0 0 1 1 2 2 1           . Use row (or column) expansion to compute det(xI A) .  The matrix 4 1 1 2 1 1 1 4 1 1 2 1 1 1 4 1 1 2 2 1 1 4 1 1 1 2 1 1 4 1 1 1 2 1 1 4 1 6 P is the projection matrix for the column space of matrix A. This matrix A is also known to be of full rank. Answer the following, giving reasons for your answers.  Find a transparent basis and the dimension for the column space of P.  Find a basis and the dimension for the column space of A .  What size is the matrix A ?  Find a transparent basis and the dimension for the null space of P.  Find a transparent basis and the dimension for the row space of P.  Find a basis and the dimension for the null space of A.  For which of the following b can you find a solution to the system Ax b ? This does not mean you should find a solution, only whether one could or not. 10 17 19 14 10 17 19 14 13 10 17 19 14 13 23 1 1 1 1 1 1 .  It is known that certain vector u is a solution to the system Ax c . Give all solutions to Ax c .  It is also known that 1 2 3 4 5 6 Ax does not have a solution. How would you change the constant vector so that there would be a solution? Extra Problems.  Fill in the blank with the best possible expression to complete the sentence truthfully. Only that one will be counted correct. 1. matrix with two equal columns will have zero determinant. 1 2 3 Some Every No 2. If A is invertible, then A commute with its inverse. 1 2 3 must always can will not 3. If A is 6  9 , then the columns of A be linearly independent. While in AT , the columns be linearly independent. 1 2 3 can have to cannot 4. Let A be square, and suppose Ax  0 has a nontrivial solution. Then detA equal 0. 1 2 3 may cannot must 5. Let A and B be 3 3. Then det (AB) equal det(A)det(B) . 1 2 3 could must couldn’t 6. Let A be square and suppose detA  0. Then have an inverse 1 2 3 will not may must always 7. Let A and B be 2  2 . Then det (A B) equal det(A)  det(B) . 1 2 3 could must could not 8. exist a 6  6 matrix all of whose entries are whole numbers and its determinant is 2 5 . 1 2 3 There does There does not There might Bonus: Consider the matrix 0 0 1 0 2 0 n 0 . Give its determinant as a function of n.

info@checkyourstudy.com Whatsapp +919911743277
(20 pts total) Continuous Probability Density a) (4 pts) Graph f when the density f(x) = k where k is a constant if −4≤?≤4 and 0 elsewhere b) (4 pts) What is the value of k? c) (4 pts) Graph F for the same functions d) (4 pts) What is the ?(0≤?≤4)? e) (4 pts) Find the interval ?(−?≤?≤?) where the probability is 95% 7) (20 pts total) Find the mean and variance of the random variable X with probability function f(x) a) (10 ???) ?(0)=0.512,?(1)=0.384,?(2)=0.096,?(3)=0.008 b) (10 ???) ?(?)=2? (0≤?≤1) 8) (20 pts total) Let X be normal with a mean of 80 and a variance of 9. Find: a) (5 pts) P(X>83) b) (5 pts) P(X<81) c) (5 pts) P(X<80) d) (5 pts) P(78<X<82)

## (20 pts total) Continuous Probability Density a) (4 pts) Graph f when the density f(x) = k where k is a constant if −4≤?≤4 and 0 elsewhere b) (4 pts) What is the value of k? c) (4 pts) Graph F for the same functions d) (4 pts) What is the ?(0≤?≤4)? e) (4 pts) Find the interval ?(−?≤?≤?) where the probability is 95% 7) (20 pts total) Find the mean and variance of the random variable X with probability function f(x) a) (10 ???) ?(0)=0.512,?(1)=0.384,?(2)=0.096,?(3)=0.008 b) (10 ???) ?(?)=2? (0≤?≤1) 8) (20 pts total) Let X be normal with a mean of 80 and a variance of 9. Find: a) (5 pts) P(X>83) b) (5 pts) P(X<81) c) (5 pts) P(X<80) d) (5 pts) P(78

The change in the internal energy of a system that absorbs 2,500 J of heat and that has received 7,655 J of work by the surroundings is __________ J. A) -10,155 B) -5,155 C) 7 −1.91×10 D) 10,155 E) 5,155

## The change in the internal energy of a system that absorbs 2,500 J of heat and that has received 7,655 J of work by the surroundings is __________ J. A) -10,155 B) -5,155 C) 7 −1.91×10 D) 10,155 E) 5,155

D) 10,155
People v. Glover 233 Cal. App. 3d 1476 (1991) Deadline is 12 hours from posting time. There is no page minimum as long as every question in the following instructions is answered thoroughly and completely. Instructions: Complete a case brief on People v. Glover 233 Cal. App. 3d 1476 (1991) and answer the following 11 questions… 1. name of case 2. legal citation and year case decided 3. character of action (how the case was brought before the appellate court) 4. facts of the case 5. legal issues in the case 6. decision of the appellate court 7. majority opinion 8. concurring opinion(s) 9. dissenting opinion 10. comment by the student 11. principle of the case (what the case stands for)