To determine which processes are involved in deadlock, let us construct the resource allocation graph (RAG) and identify all directed cycles (since each resource has a single instance, a cycle is necessary and sufficient for deadlock):
Cycle 1:
P1→R2→P2→R3→P3→R1→P1 Involving processes {P1,P2,P3} and resources {R1,R2,R3}.
Cycle 2:
P2→R4→P4→R2→P2 Involving processes {P2,P4} and resources {R2,R4}.
Now let us evaluate each option:
(A) Aborting P1: Breaks Cycle 1, but Cycle 2 (P2→R4→P4→R2→P2) still persists. Thus, the system is not deadlock-free. *(Incorrect)*
(B) Aborting P3: Breaks Cycle 1, but Cycle 2 still persists. Thus, the system is not deadlock-free. *(Incorrect)*
(C) Aborting P2: Since P2 is part of both Cycle 1 and Cycle 2, aborting P2 breaks both cycles. Resource R2 is released. Then P1 (waiting for R2) and P4 (waiting for R2) can acquire R2 and execute to completion sequentially, releasing all other resources so P3 also finishes. Hence, the system becomes deadlock-free. *(Correct)*
(D) Aborting P1 and P4: Aborting P1 breaks Cycle 1 and releases R1. Aborting P4 breaks Cycle 2 and releases R4. With R1 released, P3 (waiting for R1) acquires R1, finishes, and releases R3. Then P2 (waiting for R3 and R4) gets both resources, executes to completion, and releases all resources. Thus, the system becomes deadlock-free. *(Correct)*
Hence, (C) and (D) are the correct statements.