Design and implement a Demand Paging virtual memory simulator! It must be a text based application (NOT a GUI based one). You can use the C/C++ or Java programming language. The following algorithms must be implemented: FIFO, OPT, LRU and LFU. The application must simulate the execution of each of these algorithms on a hypothetical computer having only N physical frames (numbered from 0 to N-1, N<8), assuming that the single process that is running has a virtual memory of ten frames (numbered from 0 to 9). The number N should be a number provided in the command line as an argument. The algorithms will be simulated based on a reference string (a sequence of pages that are to be accessed) that will be either read from the keyboard or randomly generated. THE SIMULATION MUST FOLLOW THE ANIMATED EXAMPLES FROM THE ONLINE MODULE 3 AS CLOSE AS POSSIBLE IN ALL ASPECTS !!! The program should be menu-based and the menu will keep the user in a loop containing the following options: 0 – Exit Will exit the program 1 – Read reference string A reference string will be read from the keyboard and stored in a buffer. Each value of the reference string will be verified and validated (or rejected). Using option 1 again will result in overwriting the old reference string. 2 – Generate reference string A reference string will be randomly generated; the length of the reference string will be given by the user interactively. The string will be stored in a buffer. Using option 2 more than once will result in overwriting the old reference string. 3 – Display current reference string Will display the stored reference string; if there is no reference string stored yet, an error message will be displayed. 4 – Simulate FIFO Will simulate the step by step execution of the FIFO algorithm using the stored reference string; if there is no reference string stored yet, an error message must be displayed. The user will press a key after each step of the simulation to continue the simulation. The total number of faults will be displayed at the end of the simulation. 5 – Simulate OPT Will simulate the step by step execution of the OPT algorithm using the stored reference string; if there is no reference string stored yet, an error message must be displayed. The user will press a key after each step of the simulation to continue the simulation. The total number of faults will be displayed at the end of the simulation. 6 – Simulate LRU Will simulate the step by step execution of the LRU algorithm using the stored reference string; if there is no reference string stored yet, an error message must be displayed. The user will press a key after each step of the simulation to continue the simulation. The total number of faults will be displayed at the end of the simulation. 7 – Simulate LFU Will simulate the step by step execution of the LFU algorithm using the stored reference string; if there is no reference string stored yet, an error message must be displayed. The user will press a key after each step of the simulation to continue the simulation. The total number of faults will be displayed at the end of the simulation. Selecting a different option will result in an error message but the user will NOT exit the loop! Deliverables: 1. The source code of the project 2. A report document (report.doc/report.pdf/…) containing an introduction and an overview of the project, then a comprehensive description of the design and the implementation of your project. 3. A test document (test1.doc/ test1.pdf/ …) containing screensots that show the execution of the 4 algorithms using the inputs from HW6. Three screenshots are required for each algorithm: one that shows the beginning of the simulation, one in the middle of the simulation and one showing the end of the simulation. 4. A test document (test2.doc/ test2.pdf/ …) containing screensots that show the execution of the 4 algorithms using the following inputs: N=5, ref. string is: 0 1 2 3 4 5 6 7 8 9 0 9 1 8 2 7 3 6 4 5 Three screenshots are required for each algorithm: one that shows the beginning of the simulation, one in the middle of the simulation and one showing the end of the simulation. Post the source code of your simulator and the test documents under the Final Project assignment.
In: Computer Science
Design and implement a Demand Paging virtual memory
simulator!
It must be a text based application (NOT a GUI based one).
You can use the C/C++ or Java programming language.
The following algorithms must be implemented: FIFO, OPT, LRU and
LFU.
The application must simulate the execution of each of these
algorithms on a hypothetical computer having only N physical frames
(numbered from 0 to N-1, N<8), assuming that the single process
that is running has a virtual memory of ten frames (numbered from 0
to 9). The number N should be a number provided in the command line
as an argument.
The algorithms will be simulated based on a reference string (a
sequence of pages that are to be accessed) that will be either read
from the keyboard or randomly generated.
THE SIMULATION MUST FOLLOW THE ANIMATED EXAMPLES FROM THE ONLINE
MODULE 3 AS CLOSE AS POSSIBLE IN ALL ASPECTS !!!
The program should be menu-based and the menu will keep the user in
a loop containing the following options:
0 – Exit
Will exit the program
1 – Read reference string
A reference string will be read from the keyboard and stored in a
buffer. Each value of the reference string will be verified and
validated (or rejected).
Using option 1 again will result in overwriting the old reference
string.
2 – Generate reference string
A reference string will be randomly generated; the length of the
reference string will be given by the user interactively. The
string will be stored in a buffer.
Using option 2 more than once will result in overwriting the old
reference string.
3 – Display current reference string
Will display the stored reference string; if there is no reference
string stored yet, an error message will be displayed.
4 – Simulate FIFO
Will simulate the step by step execution of the FIFO algorithm
using the stored reference string; if there is no reference string
stored yet, an error message must be displayed.
The user will press a key after each step of the simulation to
continue the simulation.
The total number of faults will be displayed at the end of the
simulation.
5 – Simulate OPT
Will simulate the step by step execution of the OPT algorithm using
the stored reference string; if there is no reference string stored
yet, an error message must be displayed.
The user will press a key after each step of the simulation to
continue the simulation.
The total number of faults will be displayed at the end of the
simulation.
6 – Simulate LRU
Will simulate the step by step execution of the LRU algorithm using
the stored reference string; if there is no reference string stored
yet, an error message must be displayed.
The user will press a key after each step of the simulation to
continue the simulation.
The total number of faults will be displayed at the end of the
simulation.
7 – Simulate LFU
Will simulate the step by step execution of the LFU algorithm using
the stored reference string; if there is no reference string stored
yet, an error message must be displayed.
The user will press a key after each step of the simulation to
continue the simulation.
The total number of faults will be displayed at the end of the
simulation.
Selecting a different option will result in an error message but
the user will NOT exit the loop!
Deliverables:
1. The source code of the project
2. A report document (report.doc/report.pdf/…) containing an
introduction and an overview of the project, then a comprehensive
description of the design and the implementation of your
project.
3. A test document (test1.doc/ test1.pdf/ …) containing screensots
that show the execution of the 4 algorithms using the inputs from
HW6. Three screenshots are required for each algorithm: one that
shows the beginning of the simulation, one in the middle of the
simulation and one showing the end of the simulation.
4. A test document (test2.doc/ test2.pdf/ …) containing screensots
that show the execution of the 4 algorithms using the following
inputs: N=5, ref. string is: 0 1 2 3 4 5 6 7 8 9 0 9 1 8 2 7 3 6 4
5 Three screenshots are required for each algorithm: one that shows
the beginning of the simulation, one in the middle of the
simulation and one showing the end of the simulation.
Post the source code of your simulator and the test documents under
the Final Project assignment.
In: Computer Science
Suppose the market for burritos in Collegetown is dominated by one large monopolist. Market demand for burritos and marginal revenue are given by the equations
Qd = 120 - P
MR = 120 - 2Q
where P is the price of burritos and Q is the quantity of burritos.
Suppose furthermore that the total cost and marginal cost of producing burritos are given by the equations
TC = 10 + 60Q + Q^2 (Q^2 means Q squared)
MC = 60 + 2Q
Part 1:
Suppose that the city of Collegetown breaks up the burrito monopoly into many smaller, competitive firms. For simplicity, assume that the monopolist's original MC curve becomes the market supply curve; that is,
QS = 0.5P – 30
What will be the market equilibrium price?
Part 2:
Unfortunately, burritos create a certain negative externality. (Need I be graphic?) The marginal external cost is calculated to be 15 per burrito. What is the socially efficient quantity of burritos? Assume that the market is competitive as in 2.2.
Part 3:
What is the tax per burrito on the competitive burrito sellers that would achieve the economically efficient outcome? (Assume that the market is competitive as in 2.2.)
Part 4:
Now suppose that burritos are monopolized as in the first part of this question, AND that they generate an externality, as in the last part. What is the tax per burrito that would achieve the economically efficient outcome?
In: Economics
At carnivals and entertainment parks, there is a popular game of horse-racing. Each player has a movable horse on the display whose number corresponds to his or her alley number. The game consists of rolling a ball up an alley, where it can land in one of 15 holes. The holes are colored according to the graphic in the margin. If your ball lands in a red hole, your horse advances one space. If it lands in yellow, your horse advances two spaces, and if it lands in green, your horse gallops ahead three spaces. After your ball goes in the hole, it returns to you for your next roll. The first horse that moves 12 spaces is the winner, and the jockey, the person rolling the ball, receives a stuffed animal as a prize. One customer is at the game, bragging that he always wins after eight rolls. You look over the game and estimate that you have a 40% chance of getting the ball in a red hole, a 30% chance of getting it in a yellow hole, and a 20% chance of getting it in a green hole. There is also a 10% chance that you miss the holes, and your ball returns to you without advancing the horse. Based on your estimates of the probabilities, is it worthwhile to play the game against the bragging customer? What is the chance you will win by the eighth roll? EXCEL SHEET formulas!
In: Statistics and Probability
|
xi |
yi |
xi2 |
xi*yi |
|||||||||
|
1 |
2 |
32 |
||||||||||
|
2 |
1 |
27 |
||||||||||
|
3 |
5 |
93 |
||||||||||
|
4 |
8 |
101 |
||||||||||
|
Total |
||||||||||||
|
Avr. |
(Hint: use a special type of distribution we learned that represents the described case to find the probability)
In: Statistics and Probability
(i) Skyros’s Ventures Ltd
P. O. Box 021
Osu- Accra
24th September, 2007.
Dear George,
Thank you for coming to see me yesterday in response to our advertisement in the “Daily Graphic”. Since our legal Adviser resigned in July, a great deal of work has piled up and we are anxious to get this cleared as soon as possible.
You have indicated during our discussions that you have been dealing with such commercial cases for some time and we happy to engage you as our legal advisor.
Our secretary will make available a room and all necessary documents to enable you acquaint yourself with all outstanding cases.
Our offices are open from 8: 00 am to 5:00 p.m. and you can use our facilities if you so wish during these hours. Please be reminded that delegation of duties by your outfit is not acceptable.
Your level of fees is acceptable. We reserve the power of dismissal, but work can be cancelled with compensation rights. We hope you can start work on Monday 1st October 2007.
I look forward to seeing you then.
Yours faithfully,
Joe Ansah
(Managing Director)
Required:
Discuss whether the conditions in the letter indicate a contract of service or a contract for service.
In: Accounting
Part 1:
Scenario
You are the owner of a Vancouver hair salon. (Please make up the name and location. Use your imagination.) Due to the pandemic and a sharp decline in demand, you had to lay off all of your staff and close in March.
Now, with some pandemic restrictions lifted, your salon is once again open for business. You need to hire back your former hair stylists. Write a message to your former employees requesting that they return to work. Maintain a professional tone.
Instructions: Choose if the message should be written as an email, memo, or letter. Write the message in Word. I’m expecting less than 200 words. Upload the file to this folder when you are done. Don’t forget to proofread!
Part 2:
Scenario
Write a message to your clients explaining that your hair salon is open once again. Share with them a promotion of your choosing to entice them to make an appointment.
Instructions: Choose if the message should be written as an email, memo, or letter. Write the message in Word. I’m expecting less than 200 words. Upload the file to this folder when you are done. Don’t forget to proofread!
Grading Rubric:
Tone
Audience
Clarity
Conciseness
Cohesion
Graphic Highlighting
Formatting
In: Computer Science
The following data includes the year, make, model, mileage (in
thousands of miles) and asking price (in US dollars) for each of 13
used Honda Odyssey minivans. The data was collected from the Web
site of the Seattle P-I on April 25, 2005.
| year | make | model | mileage | price |
| 2004 | Honda | Odyssey EXL | 20 | 26900 |
| 2004 | Honda | Odyssey EX | 21 | 23000 |
| 2002 | Honda | Odyssey | 33 | 17500 |
| 2002 | Honda | Odyssey | 41 | 18999 |
| 2001 | Honda | Odyssey EX | 43 | 17200 |
| 2001 | Honda | Odyssey EX | 67 | 18995 |
| 2000 | Honda | Odyssey LX | 46 | 13900 |
| 2000 | Honda | Odyssey EX | 72 | 15250 |
| 2000 | Honda | Odyssey EX | 82 | 13200 |
| 2000 | Honda | Odyssey | 99 | 11000 |
| 1999 | Honda | Odyssey | 71 | 13900 |
| 1998 | Honda | Odyssey | 85 | 8350 |
| 1995 | Honda | Odyssey EX | 100 | 5800 |
Compute the correlation between age (in years) and mileage for
these minivans. (Assume the correlation conditions have been
satisfied and round your answer to the nearest 0.001.)
In: Statistics and Probability
5. Chapter 7: Exercise 68 on page 228
Birthrates 2015 The table shows the number of live births per 1000 women aged 15-44 years in the United States, starting in 1965.
|
Year |
1965 |
1970 |
1975 |
1980 |
1985 |
1990 |
1995 |
2000 |
2005 |
2010 |
2015 |
|
Rate |
19.4 |
18.4 |
14.8 |
15.9 |
15.6 |
16.4 |
14.8 |
14.4 |
14.0 |
13.0 |
12.4 |
A) Make a scatterplot and describe the general trend in Birth Rates (Enter Year as years since 1900: 65,70,75 etc.)
B) Find the equation of the regression of the line:
C) Check to see if the line is an appropriate model. Explain
D) Interpret the slope of the line
E) The table gives rates only at intervals. Estimate what the rate was in 1978
F) In 1978, the birthrate was actually 15.0. How close did your model come?
G) The birthrate in 2020 was not yet available when this was written. Predict the birth rate in 2020 from your model . Comment on your faith in this prediction.
H) Predict the Birthrate for 2050. Comment on your faith in this prediction.
In: Statistics and Probability
The table below contains real data for the first two decades of AIDS reporting.
| Year | # AIDS cases diagnosed | # AIDS deaths |
|---|---|---|
| Pre–1981 | 91 | 29 |
| 1981 | 319 | 121 |
| 1982 | 1,170 | 453 |
| 1983 | 3,076 | 1,482 |
| 1984 | 6,240 | 3,466 |
| 1985 | 11,776 | 6,878 |
| 1986 | 19,032 | 11,987 |
| 1987 | 28,564 | 16,162 |
| 1988 | 35,447 | 20,868 |
| 1989 | 42,674 | 27,591 |
| 1990 | 48,634 | 31,335 |
| 1991 | 59,660 | 36,560 |
| 1992 | 78,530 | 41,055 |
| 1993 | 78,834 | 44,730 |
| 1994 | 71,874 | 49,095 |
| 1995 | 68,505 | 49,456 |
| 1996 | 59,347 | 38,510 |
| 1997 | 47,149 | 20,736 |
| 1998 | 38,393 | 19,005 |
| 1999 | 25,174 | 18,454 |
| 2000 | 25,522 | 17,347 |
| 2001 | 25,643 | 17,402 |
| 2002 | 26,464 | 16,371 |
| Total | 802,118 | 489,093 |
Graph "year" vs. "# AIDS deaths." Do not include pre-1981. Label both axes with words. Scale both axes. Calculate the following. (Round your answers to the nearest whole number. Round the correlation coefficient r to four decimal places.)
a=
b=
r=
n=
In: Statistics and Probability