题目内容

As a burgler robs a house, she finds the following items:Dirt - Weight: 4, Value: 0Computer - Weight: 10, Value: 30Fork - Weight: 5, Value: 1Problem Set - Weight: 0, Value: -10This time, she can only carry a weight of 14, and wishes to maximize the value to weight ratio of the things she carries. She employs three different metrics in an attempt to do this, and writes an algorithm in Python to determine which loot to take.The algorithm works as follows:Evaluate the metric of each item. Each metric returns a numerical value for each item.For each item, from highest metric value to lowest, add the item if there is room in the bag.Describe the heuristic that each of the following 3 metrics uses, and choose the result of running the algorithm with each metric.Metric 1:def metric1(item): return item.getValue() / float(item.getWeight()) # We want exact values!Which heuristic does Metric 1 employ?

A. Choose the lightest object first.
B. Choose the most valuable object first.
Choose the item with the best value to weight ratio first.

查看答案
更多问题

Of the four delay values tested, which has the lowest variance?

A. delay of 2nd drug = 300
B. delay of 2nd drug = 150
C. delay of 2nd drug = 75
D. delay of 2nd drug = 0

The relationship between number of cured patients and when the delay occurs is linear.

Increasing mutProb will increase the number of cured patients.

What is the relationship between when drugs are applied and patients being cured?

Applying the 2nd drug earlier means the patient is more likely to be cured.
B. Applying the 2nd drug later means the patient is more likely to be cured.
C. Applying the 2nd drug too late means the patient will never be cured.
D. None of the above.

答案查题题库