Docsity

Markov Model and System Modeling Exam Questions - Prof. Paul A. Fishwick, Exams of Computer Science

Toggle sidebar
bg1
CAP 4800 and CAP 5805
EXAM 1, Computer Simulation, closed book & notes
DATE: Friday, October 12, 2007, 50 minutes
The exam lasts for 50 minutes and is 100 points total. Please answer each question.
Name: Solution
1. [Markov model] (20)
Consider the following Web site for e-commerce with 4 states: S for the start
state, B for a browsing state, C for a check-out state, and E for an end-state.
1) From the start state S the user goes to state B with probability 0.9 or to
state E with probability 0.1.
2) Given that a user is in state B, the user next goes to state C with
probability 0.1, to state E with probability 0.3, or has a 0.6 probability
of staying in state B.
3) Given that a user is in state C, the user next goes to state B with
probability 0.2, to state E with probability 0.7, or has a 0.1 probability
of staying in state C.
4) Once a user reaches an end state, the user stays there forever.
Define a Markov model using a fully labeled diagram with the probability
matrix (where row 1 = S, row 2 = B, row 3 = C, row 4 = E).
S B
E C
0.9
0.6
0.1
0.1
0.2
0.3
0.1
0.7
1.0
1.0 0.0 0.0 0.0
0.7 0.1 0.2 0.0
0.3 0.1 0.6 0.0
0.1 0.0 0.9 0.0
pf3
pf4
pf5

Partial preview of the text

Download Markov Model and System Modeling Exam Questions - Prof. Paul A. Fishwick and more Exams Computer Science in PDF only on Docsity!

CAP 4800 and CAP 5805

EXAM 1, Computer Simulation, closed book & notes

DATE: Friday, October 12, 2007, 50 minutes

The exam lasts for 50 minutes and is 100 points total. Please answer each question.

Name: Solution

1. [Markov model] (20) Consider the following Web site for e-commerce with 4 states: S for the start state, B for a browsing state, C for a check-out state, and E for an end-state. 1) From the start state S the user goes to state B with probability 0.9 or to state E with probability 0.1. 2) Given that a user is in state B , the user next goes to state C with probability 0.1, to state E with probability 0.3, or has a 0.6 probability of staying in state B. 3) Given that a user is in state C , the user next goes to state B with probability 0.2, to state E with probability 0.7, or has a 0.1 probability of staying in state C. 4) Once a user reaches an end state, the user stays there forever. Define a Markov model using a fully labeled diagram with the probability matrix (where row 1 = S , row 2 = B , row 3 = C , row 4 = E ).

S B

E C

0.1 0.3 0.

2. [Definitions + Explanations] (30) a. What are three of the most fundamental concepts in system modeling? Identify and define them. (6)

State: describes the system for an interval of time Event: a point in time that designates a change in state Time: denoted by either an integer or a real number

b. What is an autonomous system? Specify it in terms of the model components. (5)

System without an input

c. Under what circumstances is an event scheduling method more efficient than a time slicing method? (6)

The event scheduling method is efficient where the values of inputs and outputs change irregularly.

d. How does a random variable differ from a variable within a computer program? (7)

Operation Variable Random variable

get X Æ value Sample X Æ value

store X Å value X Å function with value range

4. [FSM] (35)

Consider the following vending machine. The vending machine accepts only nickels and dimes and dispenses bottled water or Coke (by pressing one of two selection buttons). Bottled water costs 15¢ and Coke costs 20¢. The machine should behave in accordance with the following specifications:

  1. A customer needs to deposit a sufficient amount of money before he/she selects an item for purchase. If the item costs more than the deposited amount, the machine waits for more coins to be inserted. We assume that a customer presses one of two selection buttons only when a sufficient amount of money for each item has been deposited.
  2. When a coin is inserted and the deposit (including the last inserted coin) is greater than 20¢, the last inserted coin is immediately returned. For example, a dime is immediately returned when the deposit is 15¢.
  3. The change is not returned even if the item costs less than the deposited amount. For example, a nickel is not returned if the customer selects bottled water when the deposit is 20¢.
  4. The vending machine does not have a "return" button. We’ll model the state by how much money has been deposited. Define the FSM of this vending machine with both (a) a fully labeled diagram and (b) a mathematical definition using <I, O, Q, δ, λ> notation.

(a) Diagram (20pts)

  • FSM (Each state is exactly identified): at least 15 pts
  • FSM (understandable) or well-drawn Flow chart: 12 pts
  • Others: 10 pts

Nickel

Water button

Coke button

Water button

Dime

Dime Dime

Nickel

Nickel

Nickel

Nickel

Dime

Dime

(b) Mathematical definition (15pts)

  • 3pts for each notation
  • I, O, Q have been graded based on the question, not your solution in (a)
  • δ and λ have been graded based on your solution in (a) or the question
  • Identify the states o Each state is defined by how much money has been deposited. o Maximum deposit is 20¢. Q = {q 0 , …, q 4 } = {0¢, 5¢, 10¢, 15¢, 20¢} O = Q
  • Identify the inputs: what causes a change in state? o Coke and water buttons also cause the amount of deposited money. I = {nickel, dime, coke button, water button}
  • δ: Q × I → Q

for i ∈ {0, 1, 2}: δ(qi, nickel) = qi+1, δ(qi, dime) = qi+

δ(q 3 , nickel) = q 4 , δ(q 3 , dime) = q 3 , δ(q 4 , nickel or dime) = q 4 , δ(q 3 , water button) = q 0 , δ(q 4 , water button) = q 1 , δ(q 4 , coke button) = q 0

  • λ: Q → O

for i ∈ {0, …, 4}: λ(qi) = qi