CMPE 220
Prof. Meikang Qiu
Computer Engineering Department
Student Name: Kiran Rokkam
SJSU ID: 008727134
Email: kiran.rokkam@gmail.com
Home Work #1
1. For the Figure below, tell me the minimum total cost while satisfying timing constraints with all guaranteed probabilities. Please use dynamic program to do it.
R1
R2
nodes
T
P
C
T
P
C
0
1
0.8
9
2
0.8
5
2
0.2
9
3
0.2
5
1
1
0.9
10
2
0.7
4
3
0.1
10
4
0.3
4
2
1
0.9
9
2
0.8
5
4
0.1
9
6
0.2
5
3
1
0.2
8
3
0.4
2
2
0.8
8
6
0.6
2
Table (b) Fig. (a)
Ans:
Dynamic programming is useful to find the best cost with best probabilities for the given set of processes. For the above table (b) we calculate dynamic table applying dynamic program with the given nodes in Fig (a).
Assumptions:
In order to apply the dynamic programming to give table and nodes, we made following assumptions.
1. Each node will take at least 1 time unit to complete its processes.
2. Node 2 and 3 are parallel processes and combined together.
3.
Procedure to apply dynamic programming:
STEP1: Please create a B-table from given the Table (a)
STEP2: Please merge nodes 2 and 3 and generate new B-table.
STEP3: Generate D-table from new B-table using dynamic programming algorithm.
STEP1:
We have to generate new table called B-table using the using table (a).
1. Identify the maximum time unit value for given nodes. It is identified as ‘6’
2. For each node and tabulate probability and cost (P, C) for each time unit until maximum time value.
Example: For node 0 at time unit 1 probability is 0.8 and cost is 9 so please tabulate as below.
3. Similarly follow