(a) Deadlock and its necessary conditions. A deadlock is a state in which a set of two or more processes are each waiting for a resource held by another process within that same set, forming a cycle of waits, so that none of them can ever proceed — no external intervention, no amount of scheduling, resolves it on its own. Four conditions must hold simultaneously for deadlock to be possible:
Mutual exclusion — at least one resource is held in a non-shareable mode (only one process may use it at a time). Example: a printer that only one process may hold.
Hold and wait — a process already holding at least one resource is waiting to acquire additional resources currently held by others. Example: a process holds a scanner and requests a printer held by another process.
No preemption — resources cannot be forcibly taken from a process; they can only be released voluntarily. Example: a lock cannot be yanked away from a process mid-critical-section.
Circular wait — there exists a cycle $P_0\to P_1\to\cdots\to P_n\to P_0$ where each $P_i$ waits for a resource held by $P_{i+1}$. Classic example: process A holds resource 1 and requests resource 2, while process B holds resource 2 and requests resource 1 — each is permanently blocked waiting on the other.
(b) Read-only files.No — a deadlock cannot occur solely from contention over read-only files. Deadlock's mutual-exclusion condition requires a resource to be held in a non-shareable way; a read-only file can be opened and read concurrently by any number of processes with no conflict, so no process ever needs to wait for exclusive access to it. With mutual exclusion never triggered for these resources, no circular wait over them can form, so deadlock cannot arise purely from read-only file access (though it remains possible if other, genuinely exclusive resources are involved).
(c) Deadlock-freedom bound for 7 processes, 15 identical resources
Given. $R=15$ identical resources; no deadlock-avoidance/prevention/detection is used (requests are granted greedily whenever a resource is free); processes $P_1..P_5$ have maximum simultaneous hold $=2$ each, $P_6,P_7$ have maximum simultaneous hold $=3$ each; each process requests/releases exactly one resource at a time.
Find. Whether deadlock can occur on this system.
Approach. Apply the standard sufficient condition for deadlock-freedom in a single-resource-type system: if the worst case in which every process holds one resource short of its maximum still leaves at least one resource spare, some process can always complete and release, guaranteeing progress.
Compute the worst-case "everyone stuck one short of max" total.
$$\sum_i (\max_i - 1) = 5\times(2-1) + 2\times(3-1) = 5\times1 + 2\times2 = 5+4=9$$
Compare against total resources. $R=15 > 9$, so even in the absolute worst case where every process is holding $\max_i-1$ resources and blocked waiting for one more, $15-9=6$ resources remain unallocated — meaning at least one waiting process's next request must be satisfiable immediately (a resource is available), letting that process reach its maximum, complete its work, and release everything it holds, which then unblocks the others in turn.
$$\boxed{\textstyle\sum_i(\max_i-1)=9 \lt R=15 \implies \text{deadlock is IMPOSSIBLE on this system}}$$