I will try to answer this in a very simple and short way, as most answer explained quiet beautifully and in details.
If you are familiar with the deadlock concept, then I will explain why the correct answer is B. Automatically you will understand why others cannot be correct answer.
GIVEN : Binary semaphore means value is 0 or 1. If P(s) has s=1, we proceed or else we are blocked. Here, in question all a,b,c,d is initialized as 1. X,Y and Z are concurrent process, so can run parallel to each other (we will use this).
Solution : See option B, For the process to complete all P operations should be passed.
- X:P(b) and Y:P(b) executed one after the other. Proceeds only when both executed.
- Next, X:P(a) and Z:P(a) executed one after the other.
- Next, X:P(c) and Y:P(c) executed one after the other. [See, here X is completed]
- Y:P(d) and Z:P(d) completed one after the other. [Y and Z completed]
So, as you can see how in option B, all the semaphores are executed one after the other and did not wait for any other semaphore to be be executed by any other process.