Banker's Algorithm You are given a system with four resources labeled A (tape drives), B (DVD drives), C (Video Cards) and D (Monitors). In this system, a process must have access to one of these resources to use it. The system begins with 5 As, 3 Bs, 2 Cs and 3 Ds There are five processes running in this system at the point in time in question. These processes are labeled simply as P1 through P5. P1 is currently allocated 1 A, 1 B and 1 D P2 is currently allocated 1 A and 1 D P3 is currently allocated 1 A, 1 B and 1 C P4 is currently allocated 1 A and 1 B P5 is currently allocated 1 A and 1 C. P1 has declared a max request of 4 As, 1 B and 2 Ds P2 has declared a max request of 1 A and 3 Ds P3 has declared a max request of 2 As, 1 B and 2 Cs P4 has declared a max request of 2 As and 2 Bs. P5 has declared a max request of 1 A and 1 C. Your available resources should be 1 D. Verify this yourself. For each question below, use the following situation. In essence, hit the reset button before you answer the next question, so that the situation is always as listed above when you begin to answer the question. 1) Show that the system is currently in a safe state. Show your work. Produce the safe sequence from the safety algorithm. 2) Assume the system above before problem 1 above. If P4 requests 1 D, should this request be granted? Explain and show your work. 3) Assume the system above before problem 1 above. If P4 requests 1 A, should this request be granted? Explain and show your work. 4) Assume the ORIGINAL system (before problem 1 above, in other words, ignore any possible granted requests from previous questions on this homework). If P2 requests 1 D, should this request be granted? Explain and show your work. 5) Assume the ORIGINAL system (before problem 1 above, in other words, ignore any possible granted requests from previous questions on this homework). If P1 requests 1 D, should this request be granted? Explain and show your work. EC) For extra credit, implement this algorithm. Use general vectors to allow for any number of resources or processes.