Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

COMPSCI 3SD3 - COMP SCI 3SD3 Virtual Take Home Examination

Rating
-
Sold
-
Pages
5
Grade
A+
Uploaded on
19-04-2023
Written in
2022/2023

COMP SCI 3SD3 Virtual Take Home Examination McMaster University Final Examination Total: 132 pts ● THIS EXAMINATION PAPER HAS 5 PAGES AND 9 QUESTIONS. ● The exam starts at 12:30 pm and ends at 3:30 pm, i.e. 180 (3hr) minutes (for students without extra time permissions). This includes the exam time (150 minutes) plus extra time for technology (30 minutes). ● Please submit the solutions via Avenue using the same procedure as for the assignments. ● Also, just in case, send the solutions via e-mail to . ● Any question during this midterm, ask by sending an e-mail to Ryszard Janicki () 1.[10] Consider the following scenario: An office is used by several workers sharing a single printer. As a simplification of a real life scenario, it is assumed that the printer is able to print any number of jobs, independently of the number of pages those jobs have, before running out of toner. The toner is replaced by a technician whenever necessary. a.[5] Provide an FSP description of the above scenario. You must provide also a brief description of the intended behavior for each one of the processes you define. Hint: Possible processes for the above scenario are PRINTER, USER and TECHNICIAN. b.[5] Provide a Petri nets (any kind) description of the above scenario. 2.[15] Two warring neighbours are separated by a field with wild berries. They agree to permit each other to enter the field to pick berries, but also need to ensure that only one of them is ever in the field at a time. After negotiation, they agree to the following protocol. When a one neighbour wants to enter the field, he raises a flag. If he sees his neighbour’s flag, he does not enter but lowers his flag and tries again. If he does not see his neighbour’s flag, he enters the field and picks berries. He lowers his flag after leaving the field. a.[8] Model this algorithm for two neighbours n1 and n2. Specified the required safety properties for the field and check that it does indeed ensure mutually exclusive access. Specify the required progress properties for the neighbours such that they both get to pick berries given a fair scheduling strategy. Are any adverse circumstances in which neighbours would not make progress? What if the neighbours are greedy? Page 2 of 5 b.[7] Model this algorithm for two neighbours using Petri nets (any kind). 3.[30] A cook puts burgers in a pot. A client checks if there is at least one burger in the pot, and if so, the client must take one. (a)[20] Assuming two clients, this can be modelled as (i)[12] Is there a trace belonging to process DS leading to an error state? If so, give the trace. (ii)[8] We wish a client to obtain exclusive access to the pot. That is, two clients cannot check the pot at the same time, and when a client checks, he/she must take a burger (if there is at least one). Show how to modify the given model such that this behaviour is ensured. (b)[10] Provide a solution with any kind of Petri nets. Note that the cook cannot put a burger in a full pot.

Show more Read less
Institution
COMPSCI 3SD3 - COMP SCI 3SD3 Virtual Take Home Exa
Course
COMPSCI 3SD3 - COMP SCI 3SD3 Virtual Take Home Exa









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
COMPSCI 3SD3 - COMP SCI 3SD3 Virtual Take Home Exa
Course
COMPSCI 3SD3 - COMP SCI 3SD3 Virtual Take Home Exa

Document information

Uploaded on
April 19, 2023
Number of pages
5
Written in
2022/2023
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$10.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
AllAcademic Other
View profile
Follow You need to be logged in order to follow users or courses
Sold
67
Member since
6 year
Number of followers
39
Documents
548
Last sold
1 month ago
All the academic resources you need.

All the academic resources you need.

3.7

7 reviews

5
3
4
1
3
2
2
0
1
1

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions