(Financial tsunami) Banks lend money to each other. In tough economic times, if a bank goes bankrupt, it may not be able to pay back the loan. A bank’s total assets are its current balance plus its loans to other banks. The diagram in Figure 8.8 shows five banks. The banks’ current balances are 25, 125, 175, 75, and 181 million dollars, respectively. The directed edge from node 1 to node 2 indicates that bank I lends 40 million dollars to bank 2.
figure 8.8 Banks lend money to each other.
If a bank’s total assets are under a certain Limit, the bank is unsafe. The money it borrowed cannot be returned to the lender, and the lender cannot count the loan in its total assets. Consequently, the lender may also be unsafe, if its total assets are under the Limit. Write a
5 201
25 2 1 100.5 4 320.5
125 2 2 40 3 85
175 2 0 125 3 75
75 1 0 125
181 1 2 125
The total assets of bank 3 are (75 + 125), which is under 201, so bank 3 is unsafe. After bank 3 becomes unsafe, the total assets of bank 1 fall below (125 + 40). Thus, bank 1 is also unsafe. The output of the program should be
Un safe banks are 3 1
(Hint: Use a two-dimensional array borrowers to represent loans. borrowers [i] [j] indicates the loan that bank i provides to bank j . Once bank j becomes unsafe, borrowers[i] [j] should be set to 0.)
Want to see the full answer?
Check out a sample textbook solutionChapter 8 Solutions
Introduction to Java Programming and Data Structures, Comprehensive Version Plus MyProgrammingLab with Pearson EText -- Access Card Package
Additional Engineering Textbook Solutions
Modern Database Management (12th Edition)
Java: An Introduction to Problem Solving and Programming (7th Edition)
Database Concepts (8th Edition)
Starting Out with Python (4th Edition)
Digital Fundamentals (11th Edition)
Introduction To Programming Using Visual Basic (11th Edition)
- Part 3 - Number is 9 Part 3: Graph TheoryUse your assigned number of vertices from “Part 3” of the “Finite Math Assignment Form: Task 3” supporting document to do the following: F. Create a weighted connected graph with the following characteristics: • The assigned number of vertices are alphabetically labeled starting with A. • Vertex A is not adjacent to vertex G. • At least two vertices have a degree greater than 2. • All weights are greater than 0. • No weights are the same. 1. Identify the degree of each vertex in your graph. 2. Explain whether the graph has an Euler trail, using definitions, properties, or theorems. 3. Describe a path from vertex A to G. 4. Find the total weight of the path from part F3. Show all work.arrow_forwardSuppose that you are given an n × n checkerboard and a checker. You must move the checker from the bottom edge of the board to the top edge of the board according to the following rule. At each step you may move the checker to one of three squares: 1. the square immediately above 2. the square that is one up and one to the left (but only if the checker if not already in the leftmost column) 3. the square that is one up and one to the right (but only if the checker is not already in the rightmost column). 1 Each time you move from square x to square y, you receive p(x, y) dollars. You are given p(x, y) for all pairs (x, y) for which a move from x to y is legal. Do not assume that p(x, y) is positive. design a recursive backtracking algorithm that determines the maximum amount of money you can recieve, when moving a checker frmo somewhere on the bottom row to somewhere on the top row. your algorithm is free to pick any squrre along the bottom row as a starting point and any square along…arrow_forward5. Icosian Game A century after Euler's discovery (see Problem 4), another famous puzzle-this one invented by the renowned Irish mathematician Sir William Hamilton (1805–1865)-was presented to the world under the name of the Icosian Game. The game's board was a circular wooden board on which the following graph was carved: Find a Hamiltonian circuit-a path that visits all the graph's vertices exactly once before returning to the starting vertex-for this graph.arrow_forward
- Bus Loading Problem. You are in charge of filling busses with passengers at a bus terminal. Each bus has space for ten (10) passengers. Four (4) of those spaces can hold only wheelchair passengers, and the other six (6) can hold only non-wheelchair passengers. Busses and both types of passengers arrive at random. As busses arrive, you are to fill them up with passengers. Once a bus is full (containing 6 non-wheelchair, and 4 wheelchair passengers), it is allowed to leave the terminal, along with its passengers. You are responsible only for loading the passengers on the bus and having the bus depart. You do not need to worry about what happens to the busses or passengers after they leave. Each bus process has available to it the functions ArriveAtTerminal(), OpenDoors(), CloseDoors(), and DepartTerminal(). Each passenger process has available to it the functions ArriveAtTerminal() and GetOnBus(). Executing GetOnBus() loads the passenger on the bus, and the function returns when the…arrow_forwardCorrect answer will be upvoted else downvoted. Computer science. In each progression you pick some integer k>0, take the top k cards from the first deck and submit them, in the request they are presently, on top of the new deck. You play out this activity until the first deck is vacant. (Allude to the notes area for the better arrangement.) We should characterize a request for a deck as ∑i=1nnn−i⋅pi. Given the first deck, output the deck with greatest conceivable request you can make utilizing the activity above. Input The main line contains a solitary integer t (1≤t≤1000) — the number of experiments. The principal line of each experiment contains the single integer n (1≤n≤105) — the size of deck you have. The subsequent line contains n integers p1,p2,… ,pn (1≤pi≤n; pi≠pj if i≠j) — upsides of card in the deck from base to top. It's dependable that the amount of n over all experiments doesn't surpass 105. Output For each experiment print the deck with…arrow_forwardBus timetables specify to the second the exact arrival and departure time of each bus on each stop. You need to pay for the full fare of every bus you ride and different bus lines charge different fees , but they are flat fees (independent of distance travelled on the line) A travel plan is a sequence of stop-time pairs where stop is a location of a bus stop and time is when we arrive at that stop. The plan is feasible if for any two consecutive pairs (a, t) and (b, t′) in the plan there exists a bus that departs after t and arrives at b at exactly t′. That is, a travel plan does not allow us to walk between stops. Assuming that no two buses arrive at the same time at the same stop, a feasible plan uniquely identifies the bus lines that we need to take to realize the plan. The cost of the plan is the sum of the fares we need to pay. Your task is to design an efficient algorithm that given a departure time t, an arrival time t′, an origin stop a and a destination stop b, finds the…arrow_forward
- DUE(17/12/21 23:00PM) Problem 1: In the below figure we have a 11*11 board. The rows and columns are numbered from 0 to 10. The picture shows the way to calculate the next move in the board. The yellow square (5,6) is the example start position and red square (7,8) is an example goal position, and the blue squares( in an order of expansion) are the possible positions resulting from one move from the start(yellow square). the moves from any point can be in an order (up 1 move, right 2 move, down 2 move, left 1 move), You should keep repeating the move upto the point you reach to the goal by using Breadth First Search algorithm. Assuming the above explained rules apply, you will solve the problem for your student number. Everybody will use the first 2 digits of their student number as a start point and the corresponding goal point which you will find at the end of the project in the table. In the table In some colums you will see ex: +5 which means you will add your student number’s…arrow_forwardCorrect answer will be upvoted else Multiple Downvoted. Don't submit random answer. Computer science. Two cells are adjoining in the event that they share a side. Thusly, every cell (x, y) has precisely three neighbors: (x+1, y) (x−1, y) (x+1, y−1) in case x is even and (x−1, y+1) in any case. At first a few cells are contaminated, all the others are sound. The course of recuperation starts. Each second, for precisely one cell (despite the fact that there may be different cells that could change its state) one of the accompanying occurs: A sound cell with something like 2 contaminated neighbors likewise becomes tainted. A contaminated cell with something like 2 solid neighbors likewise becomes sound. In the event that no such cell exists, the course of recuperation stops. Patient is considered recuperated if the course of recuperation has halted and every one of the cells are solid. We're keen on a most dire outcome imaginable: is it conceivable that the patient…arrow_forward2. (Begun in class) Write a YES instance of 3-SAT. Then draw the Vertex Cover instance that comes from your YES instance. What is K (#variables +2*#clauses). Mark the vertices that form the Vertex Cover. b. Write a NO instance of 3-Sat, and again, draw the graph from this. Mark the vertices that come as close as possible to being a Vertex Cover.arrow_forward
- (Subject Name is Artificial Intelligence)Q1: Understand the graph given below. S is where you start, G1 and G2 are goals. Information given in graph indicates 1) Heuristic values at each node 2) Values at the edges are of cost function. Perform following searches on the graph to find out for each strategy which goal is reached first and also catalogue the nodes checking out from Frontier list 1) Depth First Search 2) Breadth First search 3) Greedy Best first search 4) A* Note: For uninformed searches, always favor the left branch when there is something to choosearrow_forwardCorrect answer will be upvoted else Multiple Downvoted. Don't submit random answer. Computer science. Today the kindergarten has another gathering of n kids who should be situated during supper. The seats at the table are numbered from 1 to 4n. Two children can't sit on a similar seat. It is realized that two children who sit on seats with numbers an and b (a≠b) will enjoy if: gcd(a,b)=1 or, a partitions b or b separates a. gcd(a,b) — the greatest number x with the end goal that an is distinct by x and b is detachable by x. For instance, if n=3 and the children sit on seats with numbers 2, 3, 4, then, at that point, they will enjoy since 4 is isolated by 2 and gcd(2,3)=1. On the off chance that children sit on seats with numbers 4, 6, 10, they won't enjoy. The educator truly doesn't need the wreck at the table, so she needs to situate the children so there are no 2 of the child that can enjoy. All the more officially, she needs no pair of seats an and b that the children…arrow_forwardCorrect answer will be upvoted else downvoted. Computer science. first move is made by Alice, the second — by Bob, the third — by Alice, etc. During their turn, the player should pick one of the chips from the board and move it any sure number of cells to one side (along these lines, if the chip was in segment I, it can move to any segment j<i, and the chips in the furthest left segment can't be picked). Alice and Bob have q sets of numbers Li and Ri. For each such pair, they need to figure out who will be the victor of the game if l=Li and r=Ri. Note that these games ought to be thought about freely (they don't influence the condition of the board for the following games), and both Alice and Bob play ideally. Input The main line contains two integers n and m (1≤n,m≤2⋅105) — the number of lines and segments on the board, separately. The subsequent line contains n integers c1,c2,… ,cn (1≤ci≤m), where ci is the file of the segment where the chip in the I-th line is…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education