Each transaction contains 4 operations, so the total number of interleaved schedules of T1 and T2 is:
(44+4)=(48)=70 Conflicting operations only occur on variable Y:
Operations of T1 on Y: r1(Y) (3rd operation of T1) and w1(Y) (4th operation of T1).
Operations of T2 on Y: r2(Y) (1st operation of T2) and w2(Y) (2nd operation of T2).
A schedule is conflict serializable if its precedence graph has no cycle, which means either:
T1→T2: All operations of T1 on Y occur before any operation of T2 on Y, i.e., w1(Y) occurs before r2(Y). Since w1(Y) is the last operation of T1 and r2(Y) is the first operation of T2, all 4 operations of T1 must precede all 4 operations of T2. There is only 1 such schedule: T1T2.
T2→T1: All operations of T2 on Y occur before any operation of T1 on Y, i.e., w2(Y) occurs before r1(Y).
A schedule is not conflict serializable if and only if it produces a cycle, which happens when:
r1(Y) appears before w2(Y), and
r2(Y) appears before w1(Y).
Let us count the number of non-serializable schedules:
Among the 8 positions in the schedule, let T1 occupy 4 positions and T2 occupy the other 4.
The non-serializable condition means r1(Y) (the 3rd op of T1) appears before w2(Y) (the 2nd op of T2), while r2(Y) (1st op of T2) appears before w1(Y) (4th op of T1).
Counting the combinations of positions where this holds yields exactly 16 non-serializable schedules.
Thus, the total number of conflict serializable schedules is:
70−16=54