edited by
824 views
1 votes
1 votes
S : r1(A), r2(A), r3(A), r4(A), w1(B), w2(B), w3(B), w4(B) The number of serial schedules equal to schedule(S) but not conflict equal to schedule(S)
answer given is 5.

What i understood is for schedule to be serial. r1(A) & w1(B) must be together.

Similarly r2(A) & w2(B) must be together

Similarly r3(A) & w3(B) must be together

Similarly r4(A) & w4(B) must be together

Now w4(B) must be last one to write B.

But we can order T1, T2 &T3 in any order. 3! =6

So I am getting 6 as answer , but not 5
edited by

1 Answer

0 votes
0 votes

I found why it is 5.

for schedule to be serial. r1(A) & w1(B) must be together.
Similarly r2(A) & w2(B) must be together
Similarly r3(A) & w3(B) must be together
Similarly r4(A) & w4(B) must be together
Now w4(B) must be last one to write B.
But we can order T1, T2 &T3 in any order. 3! =6

So 6 is number of serial schedule (It is not view serial schedule , as for view serial we have to fix r1(A) also )

from this we have to subtract conflict equal schedule. 

To find number of conflict equal schedule draw dependency graph like.

 

T1 must precede T2,T3&T4 hence there is edge from T1 to T2,T3&T4

T2 must precede T3 & T4 hence there is edge from T2 to T3 & T4

T3 must precede T4 . Hence there is edge from T3 to T4.

Now find topological path from T1 to T4 {that must include all four transaction}

There only one such path i.e. T1->T2->T3->T4

hence 6-1 =5

please reply if you find something wrong in answer

No related questions found