FIRST CASE
The two processes are running concurrently, now let first parbegin executes, and it's P(SX) and P(SY), executes before parabegin of second executes P(SY) then, it would go to execute X=X+1=1, then V(SY) V(SX).
Now second Parabegin starts(remember now, the value of X is 1), and gets the control of critical section and executes, X=Y+2=(20+2)=22.
SECOND CASE
The two processes are running concurrently, now let second parbegin executes, and it's P(SY) and P(SX), executes before parabegin of first executes P(SS) then, it would go to execute X=Y+2=22, then V(SX) V(SY).
Now first Parabegin starts(remember now, the value of X is 22), and gets the control of critical section and executes, X=X+1=(22+1)=23.
THIRD CASE
The two processes are running concurrently, and the first parbegin executes, and its P(SX) executes and then there is interrupt occurs and CPU assigned with the second parbegin which executes P(SY), here comes the deadlock.