M&Ms Homework Session I 2009
Prof Scott Smith's lectures on Modeling
Due Weds Sept 30th in class
- Write a few scintillating paragraphs on the
trade-offs of precision and elegance in modeling as discussed
in class.
- Draw a Petri Net diagram for dining philosophers with
two philosophers, each picking up their two forks
simultaneously when they want to eat. (Note this problem should be
easy since there is a link below with the picture and simulation for
four philosophers, and we already did this two philosophers
diagram in class). Argue informally why this Petri net can
continually do transitions, i.e. it will never deadlock.
- Draw a Petri net for two philosophers dining, modeling the case
where each philosopher first picks up their left fork and then
picks up ther right fork. Describe one state (tokens in certain
places) where this Petri net is in a deadlock and the philosophers
are going to starve to death. Is there any way these two
philosophers eat and think for a long time but still avoid
starvation? If there is, describe the Petri Net transition sequence
illustrating this.
-
a)
Warm-up: write down the rules for playing the dining philosophers game
as we did in class
b) Recall we remarked that one way dining
philosophers applies to computers is viewing each program (e.g. Skype
/ iChat) as a philosopher and each fork as a shared resource
(e.g. Video camera / microphone). Point out good and bad points on
using dining philosophers to model how different computer programs
compete for resources, in terms of our elegance vs precision tradeoff
of models.
c) Now do the same but for the Petri net modeling of
the dining philosophers game as we played it in class: what properties
did the Petri net abstraction catch the essence of, and what
properties did it miss?
To help you with Petri Nets, feel free to look at the following:
If you have any questions email
me or stop by my office in NEB 214.
Note: some of these problems may be hard. Just give them a good
shot. If you spent three hours on this homework thats enough.