Free Essay

Exam Solution

In:

Submitted By harrisonmmari
Words 762
Pages 4
CPSC 304 – Tutorial #9 Transactions and Serializability (cont.)
March.23, 2007 Solutions

Question 1: Consider the following ordering S of transactions: T2: R(X); T3: W(X); T3: commit; T1: W(Y); T1: commit; T2: R(Y); T2: W(Z); T2: commit; T4: R(X); T4: R(Y); T4: commit. a) Draw a precedence graph for S. b) Is S conflict-serializable according to the precedence graph? Solutions: a) Precedence graph for S: T1 -> T2 -> T3 -> T4

b) S is conflict-serializable because there are no cycles in the graph. And it is also serializable (we’ve discussed this in last tutorial). The serial ordering can be seen from the precedence graph directly. Question 2: a) Draw a precedence graph for the following schedule. b) Determine if it is conflict-serializable based on the precedence graph. Transaction Time 1 2 3 4 5 6 7 8 9 10 11 12 Write(tax) Write(balance) Read(balance) Write(balance) Read(tax) Write(balance) Read(balance) Read(tax) Write(tax) Read(balance) Write(tax) Read(purchase) T1 T2 T3 T4

Solutions: a) Precedence graph: T1 goes before T3 T1 goes before T4 T2 goes before T1 T3 goes before T4 T4 goes before T1 T4 goes before T2

T1

T3

T2

T4

b) There is a cycle in the graph. Therefore, it is not conflict-serializable. Question 3: Consider the following sequence of actions, listed in the order the actions are presented to the DBMS. Assume that the concurrency control mechanism is Strict 2PL with timestamps used for “Wait-Die” (i.e., if Ti occurs before Tj, then Ti waits; otherwise Ti aborts). Describe how the concurrency control mechanism handles the sequence of actions. T1: R(X), T2: W(X), T2: W(Y), T3: W(Y), T1: W(Y), T1: Commit, T2: Commit, T3: Commit Assume that the timestamp of transaction Ti is i. Add appropriate lock and unlock requests to the sequence of actions. The DBMS processes actions in the order shown. If a transaction is blocked (waiting for a lock), assume that all of its actions are queued until it is resumed; the DBMS continues with the next action (according to the listed sequence) of an unblocked transaction. We assume that the DBMS doesn’t try to restart T2 until T1 commits. On an exam, you would be told what the abort policy was. For example, a different policy might be: don’t restart an aborted transaction until all the other transactions have finished. Solution: Wait-Die means: if Ti occurred before Tj, then Ti waits; otherwise Ti aborts. T1 gets shared lock on X T2 wants exclusive lock on X, but since T2 did not occur before T1, T2 aborts T3 gets exclusive lock on Y T1 wants exclusive lock on Y, T1 waits for T3 T3 commits & releases lock T1 gets exclusive lock on Y T1 commits & releases locks T2 restarts and gets exclusive locks on X and Y, commits & releases locks.

Question 4: Consider the following ordering S of transactions: T1: R(X), W(Y); T2: R(X), W(Y); T3: R(X), W(Y). How many schedules, if any, are conflict- equivalent to S? Solution: Recall that 2 actions conflict if they operate on the same object and at least one of them is a write. Two schedules are conflict-equivalent if they involve the same actions, and if they order every pair of conflicting actions in the same way. Here, Y is the problem; X is not a problem at all. Note that T1’s WRITE must go before T2’s WRITE, and T2’s WRITE must go before T3’s WRITE. The read for each transaction can go anywhere before that same transaction’s write. (Also, you cannot switch the ordering of reads and writes within the same transaction.) Having said all this, here is the solution: 1. There is only 1 possible location for T3’s WRITE. It must go last. This means that T3’s READ has a choice of 5 possible positions: ___ ___ ___ ___ ___ T3: W(Y) 2. After we place T3’s READ, this only leaves 4 empty spots. We have only no choice as to where to put T2’s WRITE. It MUST go in the last empty space of whichever spaces are currently left. That leaves 3 choices for placing T2’s READ. 3. Now, there are only 2 spots left. We have no choices. T1’s WRITE MUST go in the last empty spot, and T1’s READ goes in the other empty spot. This means that there are a total of 5 x 3 = 15 possible conflict-equivalent schedules.

Similar Documents

Free Essay

Lakeside

...Download Now for Free PDF Ebook Lakeside Hospital Case Solution at our Online Ebook Library. Get Lakeside Hospital Case Solution PDF file for free from our online library LAKESIDE HOSPITAL CASE SOLUTION PDF Download: LAKESIDE HOSPITAL CASE SOLUTION PDF LAKESIDE HOSPITAL CASE SOLUTION PDF - Are you looking for Ebook lakeside hospital case solution PDF? You will be glad to know that right now lakeside hospital case solution PDF is available on our online library. With our online resources, you can find lakeside hospital case solution or just about any type of ebooks, for any type of product. Best of all, they are entirely free to find, use and download, so there is no cost or stress at all. lakeside hospital case solution PDF may not make exciting reading, but lakeside hospital case solution is packed with valuable instructions, information and warnings. We also have many ebooks and user guide is also related with lakeside hospital case solution PDF, include : Applied Calculus 4th Edition Even Answers, Basic Chemical Solutions, Catalytic Solutions Inc Case Study, Calculus Early Transcendentals 7th Edition Yonsei Solutions, Congress Scavenger Hunt Answers, College Algebra Textbook Answers 2, Congress Of Vienna Guided Answers, Chapter 18 Study Guide Answers, English Grammar Third Edition Answer Key, Fac1502 Oct Nov 2012 Solution Docx, Food Safety Test Questions And Answers, Hayden Mcneil Bio 101 Lab Manual Answers, Harcourt Trophies 5th Grade Answer Key, Holt Mathematics Lesson 9...

Words: 2722 - Pages: 11

Free Essay

Eco Solution Exam

...ESSEC BUSINESS SCHOOL Département d'économie ECOI 31080/1 Pre-MSc Microéconomie Examen final 19 décembre 2012 Aucun document n’autorisé. Pas de calculette. Il y a trois exercices. Répondez à chacune d'entre eux de manière concise et précise, dans les espaces disponibles. Écrivez proprement. On ne pourra pas accorder de point à une copie illisible. Vous avez 2h. Chaque partie a le même poids dans la note finale. Dernier conseil : réfléchissez avant d'écrire ! Exercice 1 Supposez que le coût du travail est le seul coût pour les firmes dans l’industrie des téléviseurs. Avec S employés qualifiés et U employés non-qualifiés, une firme peut produire S 0.8 0.2 U téléviseurs par an. Le salaire d’un employé qualifié est de 80$ et celui d’un employé non-qualifié est de 20$. 1) Calculez le taux marginal de substitution technique entre ces deux inputs en fonction de S et U. U  PmS ( S , U ) = 0.8   S 0.2 S PmU ( S , U ) = 0.2   U  U  TMST ( S , U ) = 4   S 0.8 Une réponse alternative qui est aussi acceptée serait : TMST ( S , U )  1 S   4 U  Page: 1 Court terme : à court terme, le nombre de travailleurs qualifiés est fixé à S=1 et le nombre de travailleurs non qualifiés est variable. 2) Trouvez le coût total de court terme de production de q unités. q = S 0.8U 0.2 = U 0.2 ⇒ U = q 5 SCT (q) = 80S + 20U = 80 + 20q5 3) Pour quel niveau de prix une firme produira une quantité non-nulle de téléviseurs ? Pour quel niveau de prix...

Words: 1702 - Pages: 7

Free Essay

Heritage Case

...Budgeting Solution NEW HERITAGE DOLL COMPANY CAPITAL BUDGETING SOLUTION New Heritage Doll Company Capital Budgeting Solution a great book which gives a great insight into the workings of a new heritage doll company capital budgeting solution. Clear descriptions of various systems within the new heritage doll company capital budgeting solution. Written from an american point of view but this doesn't really detract from a great book. This is a great book, filled with information for anyone interested in New Heritage Doll Company Capital Budgeting Solution. Great for students or beginners with clear information. I would definitely recommend this New Heritage Doll Company Capital Budgeting Solution book. Here The Access Download Page of NEW HERITAGE DOLL COMPANY CAPITAL BUDGETING SOLUTION : Sign up to download New Heritage Doll Company Capital Budgeting Solution Download or Read Online new heritage doll company capital budgeting solution in PDF format New Heritage Doll Company Capital Budgeting Solution Sign up to download New heritage doll company capital budgeting solution. Date shared: Mar, 20 2015 | Download and Read Online New Heritage Doll Company Case Study Solution Sign up to download New heritage doll company case study solution. Date shared: Mar, 02 2015 | Download and Read Online Heritage Doll Case Solution Sign up to download Heritage doll case solution. Date shared: Mar, 02 2015 | Download and Read Online Capital Budgeting Case Study Solution EBOOKS...

Words: 438 - Pages: 2

Premium Essay

Econ571 Final Exam Solutions

...ECON571 Final Exam Solutions Click Link Below To Buy: http://hwaid.com/shop/econ571-final-exam-solutions/ Financial Economics (GU) 2016 Problem 1. 1 An individual with a utility function U(c) = -exp (-Ac) (where A = 30 ln 4) and an initial wealth of $50 must choose a portfolio of two assets. Each asset has a price of $50. The first asset is riskless and pays off $50 next period in each of the two possible states. The risky asset pays off zs in state s = 1, 2. Suppose also that the individual cares only about next period consumption (denoted by c1 or c2 depending on the state). The probability of state 1 is denoted by π. (a) If the individual splits his wealth equally between the two assets, fill in the following table assuming that each of three scenarios is considered. Scenario 1 2 3 (z1 , z2 ) (20,80) (38,98) (30,90) π 1/5 1/2 1/3 (c1 , c2 ) E[c] Var[c] (b) How would this individual rank these three scenarios? Explain and give reasons to support your argument. (c) Show that under each scenario the individual’s optimal decision is to invest an equal amount on each of the two assets. Problem 2. Consider an agent with a well-behaved utility function who must balance his portfolio between a riskless asset and a risky asset. The first asset, with price p1 has the certain payoff z1 while the second asset, with price p2 pays off z2 which is a random variable. The agent has an initial wealth Y0 and he only cares about next period...

Words: 368 - Pages: 2

Premium Essay

Cmp9500B Comprehensive Exam Solution

...CMP9500B Comprehensive Exam Solution Click Link Below To Buy: http://hwaid.com/shop/cmp9500b-comprehensive-exam-solution/ Question 1: Theory Theories play a vitally important role in guiding research and organizing and making sense of research findings. In spite of the great importance of theory-building and theory testing within your field of specialization, there is no generally accepted conception of what a theory is. Because your dissertation must contribute to theory, you must have a clear understanding of the variety of conceptions of theory, types of theories, and ways of contributing to theory and be able to justify how, exactly, your study contributes to theory. Part 1 Using Gelso (2006), Harlow (2009), Stam, H. (2007, 2010), Wacker (1999), and five additional peer-reviewed articles from your specialization, discuss scholarly views on the nature and types of theory. Compare and contrast at least three views of what constitutes a theory, including the view you will use in Part 3 of this question. Be sure to distinguish theory from related concepts, such as hypothesis, paradigm, model, and concept. Part 2 Using Ellis & Levy (2008), Harlow, E. (2009), and five additional peer-reviewed articles, review the scholarly literature on the relationship between theory and research and the ways research (quantitative and qualitative) can contribute to theory. Discuss at least three ways research can contribute to theory. Part 3 Pick a theory (in one...

Words: 1585 - Pages: 7

Free Essay

Science

...Detailed Lesson Plan (Grade 7) 1. Objectives After providing the necessary materials, each student; 1.1 investigates the different types of solutions: -unsaturated -saturated -supersaturated 1.2 performs an actual activity about solubility. 1.3 values the common solutions that can be found at home and can be used in daily living. 1. Learning Tasks 2.1 Topic: Solutions 2.2 Concept: The unsaturated solution has a less amount of solute to be dissolved. The saturated solution can hold no more solute to be dissolved. The supersaturated solution cannot hold more solute. 2.3 Materials 2.3.1 Textbook/Other Reference -Science Grade 7: Matter (K-12 Curriculum), pages 1-16 - http://www.infoplease.com/encyclopedia/science/solution-heat-solution.html 2.3.2 Instructional Materials - video clips, materials enumerated for the experiment and activity sheet. 2. Methodology 3.1 Daily Activities 3.1.1 Prayer/ Greetings Christ Jesus Whom we open our eyes, may you be there; When we open our ears, may you be there; When we open our mouths, may you be there; When we open our diaries, may you be there. Help us to see with your eyes; Help us to hear with your ears; Help us to speak your truth in love; Help us to make time for you… for others… for ourselves. Amen. 3.1.2 Checking of Attendance 3.1.3 Checking of Assignment 3.2 Preparatory Activities 3.2.1 Review Teacher: Class...

Words: 1391 - Pages: 6

Free Essay

Lab Report

...Osmosis Introduction: Tissues are made up of cells that have the same structure and function. In this experiment osmosis will be measured in a piece of tissue. Water potential can be determined by the changes in dimensions of the tissues when it is placed in solutions of different concentrations. Research Question: What is the effect of sucrose solution on potato cells Hypothesis: Osmosis will increase when the solutions are less concentrated with sucrose Variables: Dependant: Osmosis Independent: Length Materials: 12 large test tubes or specimen tubes with bungs, marker pen, potato chip cutter, scalpel, fine forceps, 3 watch glasses or petri dishes, ruler, 6 labeled beakers one containing 50cm^3 of distilled water and other four containing 50cm^3 of 0.2 mol dm^-3, 0.4 mol dm^-3, 0.6 mol dm^-3 and 0.8 mol dm^-3. Method: 1- Using the potato chip cutter, cut 24 chips from the potato. Cut the chips into 5cm lengths using the scalpel. Be as accurate as possible. Place 4 chips into each of six, labeled test tubes, one test tube for each of the different sucrose solutions. Pour in enough of each respective solution to cover the potato tissue. Put a bung in each one of the test tubes and label this series “potato”. 2- Repeat the method using the apple fruit or turnip root, putting four chips of tissue 5cm long into each of the second series of test tubes. Label these tubes “apple” or “turnip”. 3- Leave the tubes for at least an hour 4- After at least...

Words: 604 - Pages: 3

Free Essay

Environement Polltuion

...FUNDAMENTALS OF SURFACE MODES: ¥ COLLOIDS ¥ means ÒglueÓ in Greek ¥ was coined in 1861 by Thomas Graham. ¥ ¥ ¥ ¥ ¥ WHAT IS A COLLOID? usually consists of two phases; one continuous phase in which the other phase is dispersed. Size of particles: larger than the size of molecules and small enough for the dispersed phase to stay suspended for a longer period of time. ¥ No strict boundaries for the size limits. OFFICIAL DEFINITION ¥ In 1903 Wolfgang Ostwald formulated the official definition of a colloid: ¥ a system containing entities having at least one length scale in between 1nm and 1µm. ¥ For smaller particles there is no distinct boundaries between the phases and the system is considered a solution; ¥ for larger entities the particles will fall to the bottom due to the gravitational force, and the phases are separated. 1 2 3 MESOSCOPIC PHYSICS ¥ The particle size is in the so-called mesoscopic range in between the macroscopic and microscopic limits. LARGE INTERFACIAL AREA ¥ One very important quality of the colloids is the large interfacial area between the dispersed and the continuous phases. WHAT EFFECTS HAS THIS? ¥ This means that interface effects and hence the electromagnetic surface modes, are very important for the properties of the colloids. ¥ It costs energy to create this much surface and the particles would clump together if this isnÕt prevented. ¥ Usually the particles are charged and hence repel each other. 5 6 4 Four states...

Words: 2895 - Pages: 12

Premium Essay

Poop

...encouraged to ask question/s that is related to this module and that you don’t know the answer to and want it to be answered. The question/s can be answered by anyone in class. The instructor will allow sometime for other students to answer the question/s before contributing. You can post your questions in MODULE 2 forum under the Discussion Forums. Complete Assignment #2. The assignments are posted in the ASSIGNMENTS area of the website. Even though the homework assignments are not to be turned in and graded, you are strongly encouraged to do them to understand the material and to prepare for quizzes and tests. A complete solution to this assignment will be posted on the course website under ASSIGNMENTS on Thursday (Sept 4th). You are encouraged to review the solutions and compare your work to the solution, ensuring that you understand the reasons the solutions appear as they do. You are also encouraged...

Words: 485 - Pages: 2

Free Essay

Speech 203

... * Has no secretary The most important problem would be catching the flight for the meeting in Chicago since it’s an emergency and work related. Solutions: Getting work done for the day on the air plane on the way to the meeting. Call the secretary to find out at least some of the info for the meeting. Item#2 Problems: * Internal politicking in the company * Finding someone to replace F.T. Dickenson * Dealing with eliminating his overtime hours The two most important problems would the politicking, because someone else may feel the same way and decide to leave the company too. Also, finding someone to replace him and do his unfinished work in such a short period of time. Solution: Search for a new employee ASAP. Item#3 Problems: * Workers threatening to walk out over a co-worker * 10 votes to dismiss Foreman Edward George The workers are the most important asset to the company, so their interest should be first. Second, you have to figure out what to do about the votes to dismiss Ed George. Solutions: Talk to Ed George about his problems with his co-workers. Hold a meeting and get even more workers involved in the voting process, the take another vote. Item#4 Problems: * Overloading which can result in interruption of electrical power. * Not being reachable for Southern Power Solution: Contact Southern Power ASAP. See if they could come out and help with the problem. Item#5 Problem: * Balancing your work and his until Wednesday ...

Words: 922 - Pages: 4

Free Essay

Snnsnjs

...Name Date Class COLLIGATIVE PROPERTIES OF SOLUTIONS Section Review Objectives • Identify the three colligative properties of solutions • Describe why the vapor pressure, freezing point, and boiling point of a solution differ from those properties of the pure solvent. Vocabulary • colligative properties • freezing-point depression • boiling-point elevation Part A Completion Use this completion exercise to check your understanding of the concepts and terms that are introduced in this section. Each blank can be completed with a term, short phrase, or number. In a solution, the effects of a nonvolatile _______ on the properties of the solvent are called _______. They include _______ point and vapor pressure _______, and boiling point _______. In each case, the magnitude of the effect is _______ proportional to the number of solute molecules or ions present in the _______. Colligative properties are a function of the number of solute _______ in solution. For example, one mole of sodium chloride produces _______ as many particles in solution as one mole of sucrose and, thus, will depress the freezing point of water _______ as much. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. Part B True-False Classify each of these statements as always true, AT; sometimes true, ST; or never true, NT. 11. When added to 1000 g of water, 2 moles of a solute will increase the boiling point by...

Words: 483 - Pages: 2

Free Essay

Potato Osmolarity

... it increases the water movement out of the plant by a process called transpiration. When there is a shortage of water,  the guard cells well get smaller and close the stomata, and the transpiration process will move slower. The osmolarity would be tested with solute concentrations ranging from 0.0 M to 0.6 M.  The concentrations increased 0.1 M each time and the solute used was sucrose. The goal of this experiment was to determine which concentration had the least effect on the potato after being incubated. This information helped us estimate the osmolarity of the potato tuber tissue. Our group hypothesis is that the osmolarity of the potato will have the concentration with the 0.1 M solution. This hypothesis is based off the predicted outcome that smaller molarity concentrations will have the least effect on the potato.  The more solute added to a solution decreases the concentration of water in most cases (Kosinski).  The decrease in water concentration would then lead to a lower weight of the potato tuber once it has finished incubating. Methods & Materials: For experiment A you will need the following items: 1 large potato tuber  Forceps petri dish razor blade DI water metric ruler 7 250 mL beakers/ or disposable cups   balance that weighs to the nearest 0.01g   sucrose...

Words: 1866 - Pages: 8

Premium Essay

Abrasion Lab Report

... The purpose of the experiment was to see how abrasion works and how it affects rocks and minerals with the use of sugar cubes. I measured the mass of all 5 sugar cubes together then placed it in a jar with a lid on and shook it 20 times, as I was shaking the jar my lab partner recorded the mass that was taking with the number of times I shake the jar. After which we drew the shape of the sugar cubes when it was poured out on a paper, then we calculated the percent change. This procedure was repeated 5 times and with each trial the shaking time was increased by 20. After all the calculations was done, we graphed the data. After each trial the size and mass of the sugar cubes reduced, this was due to the pressure put on the jar as we were shaking it. Supposing little pressure was put on the jar, the outcome would have been different and would have shown little abrasion effects on minerals and rock so therefore this made me conclude that, for abrasion to have a greater impact on minerals and rocks the pressure of the water or wind must be strong to push the minerals against each other. Another factor that contributes to how abrasion works could be the amount of space the minerals and rocks have because during the experiment, the sugar cubes pumped into each other and the walls of the jar and since there wasn’t enough space for movement the sugar cubes weathered and reduce in size with the mass decreasing which I believe wouldn’t occur if there were to be enough space for the sugar...

Words: 462 - Pages: 2

Premium Essay

Effect Of Solute Concentration On Egg Osmosis

...The data solute concentration of the egg was found by taking the average percent change in mass for each percent solute concentration used in the lab and putting the data into the graph(Mass vs. Solute Concentration Over 3 Days). According to the data from the class, the solute concentration inside an egg is 25.1%. The egg would be in an isotonic solution at 25.1% solute concentration. This is when the concentration outside the egg is equal with the concentration of water inside the egg. The point of equilibrium is the point at which the trendline crosses the x-axis. At this point, the egg would no longer gain or lose mass. If the concentrations are the same inside and outside the egg, diffusion will not be able to take place. All averages...

Words: 318 - Pages: 2

Premium Essay

Carcinus Maenas Lab

...Analysis of Carcinus maenas ingestion rates Materials and methods Part 1 - Control experiment Two mussels (mytilus edulis) were opened and the mussels inside cut into 4 pieces, producing 8 pieces of roughly equal size in total. A balance was then tared with a weighing boat placed on it. Each piece of mussel flesh was placed individually and in turn into the weighing boat to be weighed. The pieces were then placed into a plastic bucket half filled with filtered seawater. The weight, time of weighing and time of immersion into the bucket were all noted down for each piece of mussel. The position of each piece of flesh inside the bucket was also taken down so as not to mix them up. One of the eight pieces was left in the bucket for the duration of the experiment until being removed and weighed at the end and was written down as “the last”. Another piece was removed frequently throughout the experiment and was given the name “the one”. The last 6 pieces were each removed once and weighed at regular intervals to provide a range of submersion times. The experiment was run for roughly 20 minutes. The method for removing and weighing the pieces of mussel was kept consistent throughout the experiment. Each piece was removed, blotted clear of any excess water and weighed. If the piece of mussel was “the one”, it was returned to the bucket of seawater, if not, it was kept aside and moist for the crab feeding (Part 2). Once all of the pieces were removed and weighed (multiple times for “the...

Words: 933 - Pages: 4