Synchronization & Concurrency

Answer & solution
Official answer: 7.0 : 7.0
Our answer: 7
After all 12 V operations have taken effect, the total number of permits available to satisfy the 20 P operations is S0+12. At least one remains blocked exactly when S0+12<20, giving the largest integer S0=7. This concerns operations remaining blocked after all issued V operations are processed, not a temporary block earlier in some ordering.
At S0=7 there are only 19 permits over the entire execution, so twenty P operations cannot all finish. At S0=8 there are twenty permits, enough eventually to release every issued P once all twelve V operations occur. A transient empty semaphore does not prove an operation will remain blocked after future signals.