The team of Sheldon, Leonard, Howard, and Raj are participating in a Kayak competition. Their entire...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
The team of Sheldon, Leonard, Howard, and Raj are participating in a Kayak competition. Their entire team should cross a river in 34 minutes or less to win. There are only two Kayak's available, each Kayak can seat one person. So, at most two people can row across the river at a time. One member of the team would then have to tow the empty Kayak back to the other riverbank so others could cross. The team begins on the same riverbank with two Kayaks. Each person rows the Kayak at a different pace. Raj takes 2 minutes to row across the river. • Howard takes 4 minutes to row across the river. Leonard takes 10 minutes to row across the river. Sheldon takes 20 minutes to row across the river. For sake of simplicity assume a pair starts in their Kayak at the same time, the two row at the speed of the slower rower and get across together (this assumption does not matter in terms of reaching to the other bank of river since there are only two available Kayaks). Additionally, this would ensure both Kayaks are together on the same bank of the river. Example - If Raj and Sheldon start together, 20 minutes would have passed when they cross the river. If Sheldon then returns in his kayak and tows along the other empty Kayak, another 20 minutes would have passed. The total time would be greater than 34 minutes and they would lose. Your job is to help their team win! Hint: You can model the problem as state space search. A start state, goal state, in between states that would lead to the goal. Name the two banks of river as source 's' and destination 'd'. State can be represented as a group of five elements. Example: Start state: [s,s,s,s,s]. First four elements represent the riverbank (source 's' or destination 'd') where Raj, Howard, Sheldon, and Howard are respectively. Fifth element represents location of the Kayaks. An intermediate state: [d,d,s,s,d] means Raj and Howard on the destination riverbank with Kayaks. Goal state: [d,d,d,d,d] entire team and Kayaks on the destination riverbank. To ensure search does not get stuck in cycles keep track of states visited, only visit a state if it was not previously visited. Compute total time and if it exceeds 34 minutes then do not further explore that path. Write a computer program that implements the solution to above problem. Implement your code in one of the programming languages: JAVA, Python, C++, C#, C, Prolog. Evaluate immediate child states of a parent state from left to right. Your code should print the solution as below: If there is no path that costs 34 minutes or less to the goal your program should print: No solution to the goal exists. If solution is found your program should print the full current path line by line - each state in the current path to the goal, cumulative time at each state, and interpretation of each state. Example: Path to the goal found. [s,s,s,s,s] 0 [d,s,s,d,d] 20 [s,s,s,d,s] 22 At source - Raj Howard Leonard Kayaks At destination - [d,d,d,d,d] 34 At source - Howard Leonard At destination - Raj Sheldon Kayaks At source - Raj Howard Leonard Kayaks At destination - Sheldon <so on and so forth> At source - At destination - Raj Howard Leonard Sheldon Kayaks What to turn in Submit your work electronically as below two separate files. You can upload multiple files on Canvas. 1. Source code. Note that the acceptable files are Python- .py (convert your Jupyter notebook to .py), JAVA - .java, C++.cpp, C-.C, C# - .cs, Prolog-plain text file. 2. Screen shot of your output generated from program run. You will lose points if you do not include screen shot of program run. If you worked as pair, only one member should upload the homework. Names of both members should appear as comment at the top of your source code, another option is to let me know by way of adding comment in canvas. The team of Sheldon, Leonard, Howard, and Raj are participating in a Kayak competition. Their entire team should cross a river in 34 minutes or less to win. There are only two Kayak's available, each Kayak can seat one person. So, at most two people can row across the river at a time. One member of the team would then have to tow the empty Kayak back to the other riverbank so others could cross. The team begins on the same riverbank with two Kayaks. Each person rows the Kayak at a different pace. Raj takes 2 minutes to row across the river. • Howard takes 4 minutes to row across the river. Leonard takes 10 minutes to row across the river. Sheldon takes 20 minutes to row across the river. For sake of simplicity assume a pair starts in their Kayak at the same time, the two row at the speed of the slower rower and get across together (this assumption does not matter in terms of reaching to the other bank of river since there are only two available Kayaks). Additionally, this would ensure both Kayaks are together on the same bank of the river. Example - If Raj and Sheldon start together, 20 minutes would have passed when they cross the river. If Sheldon then returns in his kayak and tows along the other empty Kayak, another 20 minutes would have passed. The total time would be greater than 34 minutes and they would lose. Your job is to help their team win! Hint: You can model the problem as state space search. A start state, goal state, in between states that would lead to the goal. Name the two banks of river as source 's' and destination 'd'. State can be represented as a group of five elements. Example: Start state: [s,s,s,s,s]. First four elements represent the riverbank (source 's' or destination 'd') where Raj, Howard, Sheldon, and Howard are respectively. Fifth element represents location of the Kayaks. An intermediate state: [d,d,s,s,d] means Raj and Howard on the destination riverbank with Kayaks. Goal state: [d,d,d,d,d] entire team and Kayaks on the destination riverbank. To ensure search does not get stuck in cycles keep track of states visited, only visit a state if it was not previously visited. Compute total time and if it exceeds 34 minutes then do not further explore that path. Write a computer program that implements the solution to above problem. Implement your code in one of the programming languages: JAVA, Python, C++, C#, C, Prolog. Evaluate immediate child states of a parent state from left to right. Your code should print the solution as below: If there is no path that costs 34 minutes or less to the goal your program should print: No solution to the goal exists. If solution is found your program should print the full current path line by line - each state in the current path to the goal, cumulative time at each state, and interpretation of each state. Example: Path to the goal found. [s,s,s,s,s] 0 [d,s,s,d,d] 20 [s,s,s,d,s] 22 At source - Raj Howard Leonard Kayaks At destination - [d,d,d,d,d] 34 At source - Howard Leonard At destination - Raj Sheldon Kayaks At source - Raj Howard Leonard Kayaks At destination - Sheldon <so on and so forth> At source - At destination - Raj Howard Leonard Sheldon Kayaks What to turn in Submit your work electronically as below two separate files. You can upload multiple files on Canvas. 1. Source code. Note that the acceptable files are Python- .py (convert your Jupyter notebook to .py), JAVA - .java, C++.cpp, C-.C, C# - .cs, Prolog-plain text file. 2. Screen shot of your output generated from program run. You will lose points if you do not include screen shot of program run. If you worked as pair, only one member should upload the homework. Names of both members should appear as comment at the top of your source code, another option is to let me know by way of adding comment in canvas.
Expert Answer:
Answer rating: 100% (QA)
This problem can be solved using a depthfirst search alg... View the full answer
Related Book For
Smith and Roberson Business Law
ISBN: 978-0538473637
15th Edition
Authors: Richard A. Mann, Barry S. Roberts
Posted Date:
Students also viewed these programming questions
-
When analyzing items on the comparative statements of financial position, what must be done to convert them to the cash basis?
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
The Crazy Eddie fraud may appear smaller and gentler than the massive billion-dollar frauds exposed in recent times, such as Bernie Madoffs Ponzi scheme, frauds in the subprime mortgage market, the...
-
The following information was drawn from the 2016 accounting records of Ozark Merchandisers: 1. Inventory that had cost $21,200 was sold for $39,900 under terms 2/20, net/30. 2. Customers returned...
-
Equipment was purchased on January 2, 2010, for $24,000, but no portion of the cost has been charged to depreciation . The corporation wishes to use the straight-line method for these assets, which...
-
In Problems 1-3 sketch the level curve z = k for the indicated values of k. 1. 2. 3. z = x2 + y2), k = 0.2, 4. 6. 8 z=, k =-2-1.0.1.2 z=, k=-4,-1,0,1,4
-
Suppose the purchase price of the forklift is \($20,000,\) its residual value in four years is certain to be \($6000,\) and there is no risk that the lessee will default on the lease. If the...
-
Petron Corporations management team is meeting to decide on a new corporate strategy. There are four options, each with a different probability of success and total firm value in the event of...
-
1. Which of the following is a CORRECT statement? 2. 3. (a) 2.3056+10.138-7.4671 = 4.9765 (b) 2.38 x 1.0 = 2.38 8.05 (c) -=2.6 3.1 (d) (1.11 0.1) x 9.0 = 9.0 A projectile travels at 0 below...
-
John Campbell, an employee of Manhattan Construction Company, claims to have injured his back as a result of a fall while repairing the roof at one of the Eastview apartment buildings. He filed a...
-
Case 1. Susan Casey is the controller of Casey's Collectibles. The business uses the accrual method of accounting and recognizes sales revenue in the period in which the sale is made. As a result,...
-
A box contains twenty-five more dimes than nickels. How many of each type of coin is there if the total value is \(\$ 7.15\) ?
-
State whether each statement in Problems 3-12 is true or false. If it is false, explain why you think that is the case. The test point \((-2,4)\) satisfies the inequality \(y>2 x-1\).
-
Is \(\{(4,3),(5,-2),(6,3)\}\) a function? Tell why or why not.
-
Show that the equation of the line with \(x\)-intercept \(a\) and \(y\)-intercept \(b\) is \[\frac{x}{a}+\frac{y}{b}=1\] \((a eq 0, b eq 0)\). This is called the intercept form.
-
Which of the sets in Problems 3-14 are functions? \(\{(5,0)\}\)
-
Which of the following is a complex sentence? Because she was bright and ambitious, she became manager in no time. She was bright and ambitious, and she became manager in no time. O She was bright...
-
Find the radius of convergence in two ways: (a) Directly by the CauchyHadamard formula in Sec. 15.2. (b) From a series of simpler terms by using Theorem 3 or Theorem 4.
-
On June 1, Smith contracted with Martin doing business as Martin Publishing Company to distribute Martins newspapers and to account for the proceeds. As part of the contract, Smith agreed to furnish...
-
This is an action by purchasers of 5 percent convertible subordinated fifteen year debentures of BarChris Construction Corporation (BarChris). * * * The action is brought under Section 11 of the...
-
[Harold Lang Jewelers, Inc. (Lang)] filed suit * * * alleging that Johnson owed it $160,322.90 plus interest for jewelry sold or consigned. Johnson answered * * * asserting as one of its eight...
-
A sodium atom in the \(3 p\) state emits a photon, decreasing the energy of the atom by \(2.10 \mathrm{eV}\). By how much does the orbital angular momentum of the atom change? Does it increase or...
-
Assume instead that the spot exchange rate between the dollar and Swiss franc is a fixed or pegged rate within a narrow band around a central rate. For each change shown in Problem 9, assume that...
-
A 1.5 V D-cell battery is rated at \(15,000 \mathrm{~mA} \cdot \mathrm{h}\). For how long could such a battery power a flashlight bulb rated at \(1.5 \mathrm{~W}\) ?
Study smarter with the SolutionInn App