Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

depiction In the present lab we will expand on code written to perform broadness first hunt on a chart. A benefit of utilizing broadness first

depiction

In the present lab we will expand on code written to perform broadness first hunt on a chart. A benefit of utilizing broadness first inquiry is that the briefest way through the (unweighted) diagram is found. We will probably delineate how this calculation can execute in a nonexclusive style on charts addressing various issues, without changing the code for the center calculation by any means. Just the diagram needs to change. Likewise note that if profundity first hunt is to be performed rather the code might be altered by utilizing a stack rather than a line.

Download the starter code which contains two .cpp records. You will modifiy these by carrying out the build_graph() capacity to address two fun riddles that are notable in the realm of sporting science.

Puzzle 1: The Wolf, Goat, and Cabbage

You are remaining with a wolf, goat, and cabbage, close to a stream, and you might want to move every one of the three of these things to the opposite side. Notwithstanding, you just approach a little boat that can fit all things considered one thing (other than yourself). In the event that you let the wolf and goat be unattended, awful things happen to the goat. In the event that you leave the goat and cabbage unattended, awful things happen to the cabbage.

For this riddle, you will have 24 = 16 states (hubs), since every one of the 4 items being referred to (yourself, the wolf, the goat, and the cabbage) can be either on the left half of the waterway or the correct side. A characteristic method to address a hub is utilizing a whole number in the reach 0 ... 15, where every one of the whole number's 4 pieces addresses one article (0 for left side, and 1 for right side). One could likewise possibly utilize a length-4 series of zeros and ones. The drawback of utilizing whole numbers is the requirement for bitwise control (e.g., taking a gander at explicit pieces), however then again it's a lot simpler to count through whole numbers in 0 ... 15 than length-4 twofold strings. The portrayal of a specific state (which is now remembered for the code) is every thing is appointed a piece position (#of bits left of furthest right piece in number worth): 0 for wolf, 1 for goat, 2 for cabbage and 3 for yourself; a worth of 0 shows the thing is to one side of the stream, 1 demonstrates the thing is to one side. The beginning state is 0 (0000): all things to left and the completion state is 15 (1111): all things to right.

At the point when you print out the grouping of hubs in an answer, the condition of every hub ought to be imprinted on a solitary line in a comprehensible configuration like this:

wolf cabbage |river| goat you

Furthermore the activity to arrive at each state will be shown before the condition of the hub. The beginning hub is the underlying state so there is no activity to arrive at this hub so "Introductory state: " is shown before the state rather than an activity. Subseqent states will show an activity before them, the string for this activity to be shown is created by state_string() and will be put away in the edge_label map as the worth from a source,target state pair with a specific activity. Subsequently the initial segment of the arrangement should print as follows (should coordinate precisely):

Introductory state: wolf goat cabbage you |river|

Cross with goat: wolf cabbage |river| goat you

...

To work with this the state_string(), print_path(), and neighbor_label() capacities are given. The portrayal of a condition of the riddle is given just as the fundamental() work. You will execute the build_graph() capacity and you may likewise compose any extra aide capacities, adjusting wolfGoatCabbage.cpp

image text in transcribedimage text in transcribedimage text in transcribed
A mathematical equation was generated from the data to show the relationship between length and weight of the koala population. The equation is below: W = 0.17 L - 3.3 where W is the weight in kilograms and L is the length in centimetres. (e) Use the equation to predict the weight of a koala which is 67 [3] cm long. Is this a reasonable prediction? Explain in a statement. (f) Transpose the equation to make L the subject. [2] (g) Using the original or transposed equation, predict the length (to [2] one decimal place) of a koala which weighs 7.2kg. (h) Circle the data point on the graph which represents a koala [1] which is 80cm long and weighs 10.5 kg. 6PW Generators, Inc. produces and sells two models of propane powered generators used for electricity generation in recreational vehicles. The "Junior\" model generates 2,50!) watts while the \"Max" model generates 3.5m watts. The company operates a factory where the generators are produced using components purchased from an independent manufacturing plant in Mexico. Each generator must be assembled, tested, and packaged [installed in the motor casing}. For each .lunior model generator, the labor requirements are 12 hours for assembly, 4 hours for testing, and 2 hours for packaging. For the Max, the labor requirements are 15 hours for assembly, 6 hours for testing, and 1 hours for packaging. For the coming month, the company has available a maximum of Lil-til hours of assembly labor, 65D hours of testing labor, and 251} hours of packaging labor. Also, the company has a contract to deliver 5O Junior model generators {so at least that many must be produced]. Prot on the Junior model is $100 per generator. and profit on the Max model is 5211] per generator. What should be R'il' I.Eenerator's production plan for the coming month in order to maximize prot? 1. '5on this rst manually: a. 1lll'ii'rite the complete mathematical formulation for this Linear Programming problem. Use decision yariable x1 for the number oflunior generators and K: for the number of Max generators. b. Graphically obtain the optimal solution: Use the attached sheet of scaled paper or your own sheet of graph paper. Manually create an accurate graph showing all constraint lines. Lightly shade the feasible region. Show one example profit line as a dashed line using a profit of $15,DDD. Circle the optimal solution. Label all parts as is done in your text. To receive any credit, this graph must be to scale, neatly done, and easy to read. 6. Solve the problem. Amanda wants to retire in 15 years. At that time she wants to be able to withdraw $2,500 at the end of each month for 20 years. Assume that money earns 10% per year compounded monthly. To the nearest dollar, what lump sum will Amanda need to deposit now so that she can start making her $2,500 withdrawals 15 years from now? (Hint: Assume 10% interest rate per year for all time periods.) A) $58,165 B) $59,105 C) $62,017 D) $60,060 9. Solve the problem. Three different clothing stores order the following amounts of clothing by a certain designer: Jackets Shirts Suits Store 1: 70 30 40 Store 2: 60 90 10 Store 3: 80 50 20 The unit prices of each product are given below for two suppliers: Supplier X Supplier Y Jacket 170 200 Shirt 60 80 Suit 320 360 What matrix product displays the cost to each store of buying the clothes from each supplier? Display the two matrices that must be multiplied and their product. A) 70 30 40 170 200 41,400 47,600 60 90 10 60 80 = 26,500 31,200 80 50 20 320 360 13,800 16,000 B 70 60 80 170 200 57,300 30 90 50 60 80 = 41,600 40 10 20 360 50,200 C 70 40 170 200 26,500 30,800 60 90 10 60 80 = 18,800 22,800 80 50 20 320 360 23,000 27,200 D 70 30 40 370 50 90 10 140 = [ $7,300 41,600 50,200 ] 80 50 20 680

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

College Algebra

Authors: Mark Dugopolski

5th Edition

0321899822, 9780321899828

More Books

Students also viewed these Mathematics questions