Preview

S12 Midterm Sol

Powerful Essays
Open Document
Open Document
2644 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
S12 Midterm Sol
UNIVERSITY OF WATERLOO
CS 350 MIDTERM :: SPRING 2012
Date: Monday, June 25, 2012
Time: 7:00 – 8:50 pm
Instructor: Dave Tompkins
Exam Type: Closed book
Additional Materials Allowed: none

Last Name: SOLUTION
First Name: ____________________________
Student #:

__ __ __ __ __ __ __ __

UW Login: __ __ __ __ __ __ __ __
Signature:

____________________________

Question Out Of

INSTRUCTIONS
1. Before you begin, make certain that you have one exam booklet with 8 pages (double sided)
2. All solutions must be placed in this booklet.
3. If you need to make an assumption to answer a question, state your assumption clearly.
4. When writing code, you should use C or C-like pseudocode. You do not have to worry about
#include statements or semi-colons.
5. If you need more space, use the last page, and indicate that you have done so in the original question.
6. A big gap after a question does not necessarily mean that a long answer is expected.
7. Did you see in the marking guide there's a bonus question? woo-hoo! Make sure you answer it at the end.
8. Relax! Read this instruction as often as needed.

CS350 Midterm

Spring 2012

AVG

1

10

6.2

2

15

9.5

3

5

4.1

4

16

9.0

5

12

10.6

6

4

2.4

7

18

5.8

8

20

11.6
0.9

Bonus
Total

100

60.0

Page 1

Question 1 [10 Marks] (a) [3 Marks] In OS/161 there is a struct thread to represent a thread context and a struct trapframe to represent a trap frame. Describe something that is contained in both structures, and then for each of the structures describe something that it contains that the other does not. Briefly explain why each of the 3 things you describe appears where it does.

Almost ALL registers are stored in a trap frame when a trap occurs (interrupt/syscall/exception), but only a subset are backed up when a thread context switch occurs. So (for example) s1 would be in both, but temp register t0 would only be in the trapframe. The thread context also has threadspecific information, such as

You May Also Find These Documents Helpful

  • Good Essays

    Sc121 Unit 2 Assignment

    • 985 Words
    • 4 Pages

    In this unit we are talking about Cholesterol and how a group of organic compounds make up 18-25% of one’s body mass called lipids. So why are lipids important? Lipids are important because they are used in the body to transport vitamins, they are essential in breaking down Cholesterol and they are used for body insulation. Lipids are best obtained from vegetable oils and legumes. But, the question is can the body produce essential fatty acids (ETA’S)? No, our body is not able to produce these fatty acids on its own. So it is necessary that you eat a diet rich in these crucial building blocks to maintain a healthy body. Two main essential fatty acids are to be included in our diet are the Omega-3 and Omega-6.…

    • 985 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    The archive deadline for Q3 is this Saturday, Dec. 10th. Please refer to the archive tracker, named “ACB Q3 Archive Tracker.xlsx” for any comments, highlights, or notes within the documentation. Also, please check the “Review_Notes_Report.xlsx” to check for any review notes that need to be cleared or closed out. Both files can be found in temporary files in the Archive Engagement task by following the link below.…

    • 69 Words
    • 1 Page
    Satisfactory Essays
  • Satisfactory Essays

    Appm 3750 Exam 1 Sp13

    • 828 Words
    • 4 Pages

    APPM 3570 — Exam #1 — February 20, 2013 On the front of your bluebook, write (1) your name, (2) 3570/EXAM 1, (3) instructor’s name (Bhat or Kleiber), (4) SPRING 2013 and draw a grading table with space for 4 problems. Do only 4 of 5 problems. On the front of your blue book, write down which 4 problems you are attempting, if you do more than 4 problems, only the first 4 problems done will be graded. Correct answers with no supporting work may receive little or no credit. Start each problem on a new page in your bluebook. At the end of the exam, please sign the honor code pledge printed on your bluebook. No books, notes or electronic devices of any kind are allowed. Show all work, justify your answers. 1. (25 pts) Suppose events A, B and C, all defined on the same sample space, have the following probabilities: P(A) = 0.22, P(B) = 0.25, P(C) = 0.28, P(A ∩ B) = 0.11, P(A ∩ C) = 0.05, P(B ∩ C) = 0.07 and P(A ∩ B ∩ C) = 0.01. For each of the following parts, your answer should be in the form of a complete mathematical statement. (a) Let D be the event that at least one of A, B, C occurs. Describe D using set notation and a Venn diagram. Find P(D). (b) Let E be the event that exactly one of A, B, and C occurs. Describe E using set notation and a Venn diagram. Find P(E). (c) What is the probability that A will occur and B will not occur? (d) Given that A has occurred, compute the probability that B will occur. (e) Given that at least one of the three events has occurred, compute the probability that all three events will occur. 2. (25 pts) A mechanic at a local car dealership is parking cars in a lot. The mechanic plans to park 4 Hondas, 4 Toyotas and 2 Subarus in a row, with all orderings equally likely. (a) Carefully define the sample space. (b) How many ways are there to park the cars in a row if each car is distinct? What about if we only identify each car by its manufacturer? (c) Suppose the cars are randomly parked in a row, find the probability that two Subarus are…

    • 828 Words
    • 4 Pages
    Satisfactory Essays
  • Satisfactory Essays

    When we have objective data on the probability of an event, we are involved with decision making under conditions of risk.…

    • 700 Words
    • 5 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Assignment Part 2 T3 2014

    • 404 Words
    • 32 Pages

    MPF753 T3 2014 – Assignment Part 2 Due by: 4:59PM Monday, 12th Jan 2015 Q1. Pick any three companies with shares currently listed on the ASX that have been trading for at least five years. Go to DatAnalysis (accessible via Deakin Library website) and download the adjusted month-­‐ end closing stock prices of these companies for the previous 61 months ended 31/10/2014 onto a MS Excel spreadsheet. Use the downloaded data and perform necessary calculations to answer the questions a) to c): a) Compute the individual monthly returns, average monthly return, variance and standard deviation of the monthly returns for the stocks of the companies you have chosen.…

    • 404 Words
    • 32 Pages
    Satisfactory Essays
  • Good Essays

    Math Midterm

    • 1005 Words
    • 5 Pages

    Simulation results will always equal analytical results if 30 trials of the simulation have been conducted.…

    • 1005 Words
    • 5 Pages
    Good Essays
  • Satisfactory Essays

    There are several roles within the health information management (HIM) profession. A HIM professional gathers, preserves, evaluates and guard’s personal health information within many different health care settings. One of the most important duties in regards to a HIM professional is ensuring compliance and upholding the current regulations in the health care industry. This paper will take a closer look at the specifics of what a HIM professional does to ensure compliance as well as the importance of education and certifications that many employers are now requiring for potential candidates in the HIM field.…

    • 444 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    A hospital is a place where a person can go to get medical treatment and health diagnoses…

    • 2208 Words
    • 8 Pages
    Powerful Essays
  • Good Essays

    The fourth ward in Houston is also known as Freedmen;s Town is one of the Houston’s historic community. In the late nineteenth century, it was the hub of black cultural community in the city. African Americans and were treated as second-class citizens, but they made a valuable contribution towards the commercial and educational development of Houston. At the end of the Civil War, developed new churches, schools, and other social organizations serve the need of the community. Freedmen’s community housed prominent educational institutes and also majority of doctors and attorneys are also in this community. In the nights the bars and night spots attracts whites and blacks. In the commercial market, they established newspapers like the Dallas Express, Houston Informer, many grocery stores and businesses were also established which helped African-American clientele to survive in the city of Houston.…

    • 752 Words
    • 2 Pages
    Good Essays
  • Good Essays

    It-250 Week 5 Questions

    • 397 Words
    • 2 Pages

    1. What function does every C program have? Why should you split large programs into several functions?…

    • 397 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    I. Short Answer (40 points). Answer 4 (and only 4) of the following 6 questions. 1 Market demand function is given by Q = 20 – 2P. A price change occurs that simultaneously raises revenue and increases consumers’ surplus. What is the direction of the price change? What can you tell me about price in this market prior to the change? What can you infer about the price elasticity of demand before the price change? A firm’s production function is given by Q = 4K0.5L0.5, where K is capital and L is labor. Suppose that w = 2 and r = 2. How much K and L would the firm optimally employ to produce 64 units of output? What is the total cost of producing this level of output? Demand is given by QD = 20 – P. Supply is given by QS = 10. What price ceiling does the government set in this market if consumers are better off by $50 under the price ceiling relative to the free-market outcome? The airlines have estimated that the average price of an airline ticket would rise by $40 if the government mandated child safety seats on airplanes. The government believes this policy would reduce fatalities on airplanes by 400 per year. The demand function for automobile travel is QM = 200 - PG + I + 0.75PA, were QM is quantity of miles driven per year (in units of 100,000 miles), PG is the price per gallon of gasoline, I is per-capita income (in thousands of dollars) and PA is the average price of an airline ticket (in dollars). The government estimates that there are 10 automobile fatalities for each 100,000 miles driven. Determine whether mandating child safety seats on airplanes will save lives? Provide the economic rationale for your answer. Quantity demanded is given by Q = 40 – 2P. What is the price that prevails in this market if consumer surplus is equal to 64? What is the price elasticity of demand at this price? Suppose that the production function for your…

    • 918 Words
    • 4 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Nvq Level 2 Assignment 20

    • 655 Words
    • 3 Pages

    Avi) A PDP is a Personal Development Plan and is developed between you and your manager. Your manager will record information about your learning and development needs in work. It should include things like targets, agreed objectives and activities to meet them and standards that are required. All of this is built into your appraisal.…

    • 655 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    1 12. 2 13. 1 14. 2 15. 1 16. 2 17. 1 18.…

    • 2040 Words
    • 9 Pages
    Satisfactory Essays
  • Good Essays

    PT 1420 Assignment 3

    • 676 Words
    • 3 Pages

    Assignment statements that perform operations with the variables a, b, and c* (*Actually none of these operations involves the variable c at all... is this an error, or a 'trick answer'?):…

    • 676 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Math IA Final

    • 2831 Words
    • 104 Pages

    Angeline Foote 00215-­‐0022 Mathematics SL Inter’l School of Tanganyika 2014 The Birthday Paradox: An Exploration of Probability Angeline Foote Candidate number: 00215-­‐0022 Mathematics Standard Level Teacher: Mr. Michael Smith International School of Tanganyika 2014 1 Angeline Foote 00215-­‐0022 Mathematics SL Inter’l School of Tanganyika 2014 Introduction The birthday paradox states that in a room of 23 people, there is a 0.5 probability that at least two people share the same birthday (Weisstein).…

    • 2831 Words
    • 104 Pages
    Good Essays