1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
DochEvi [55]
3 years ago
12

Suppose we are managing a consulting team of expert computer hackers, and each week we have to choose a job for them to undertak

e. The set of possible jobs is divided into low-stress and high-stress jobs. If we select a low-stress job for the team in week i, then we get a revenue of li > 0 dollars; if we select a high-stress job, we get a revenue of hi > 0 dollars. The catch, is that in order for the team to take a high-stress job in week i, it is required that they do no job (of either type) in week i − 1; they need a full week of prep time to get ready for the crushing stress level. On the other hand, it is okay for them to take a low-stress job in week i even if they have done a job (of either type) in week i − 1. Given a sequence of n weeks, a plan is specified by a choice of "low-stress", "high-stress", or "none" for each of the n weeks, with the property that if "high-stress" is chosen for week i > 1, then none has to be chosen for week i − 1. (It is okay to choose a high-stress job in week 1.) The value of the plan is determined in the natural way: for each i, we add li to the value if we choose "low-stress" in week i, and we add hi to the value if we choose "high stress" in week i. (We add 0 if we choose "none" in week i.) Give an efficient algorithm that takes values for l1, l2, . . . , n and h1, h2, . . . , hn and returns the value of an optimal plan.
Engineering
1 answer:
lina2011 [118]3 years ago
7 0

Answer:

if number == 1

  then

  tempSolution= max(l[number],h[number])

else if number == 2 then

  tempSolution= max(optimalPlan(1, l, h)+ l[2], h[2])

else

  tempSolution= max(optimalPlan(number − 1, l, h) + l[number], optimalPlan(number − 2, l, h) + h[number])

end if

return Value

FindOptimalValue(number, l, h)

for itterator = 1 ! number do

  tempSolution[itterator] = 0

end for

for itterator = 1 ! number do

  if itterator == 1 then

      tempSolution[itterator] max(l[itterator], h[itterator])

  else if itterator == 2 then

      tempSolution[itterator] max(tempSolution[1] + l[2], h[2])

  else

      tempSolution[itterator] max(tempSolution[itterator − 1] + l[itterator], tempSolution[itterator − 2] + h[itterator])

  end if

end for

return Value[number]

OPtimalPlan(number, l, h, Value)

for itterator = 1 ! number do

  WeekVal[itterator]

end for

if tempSolution[number] − l[number] = tempSolution[number − 1] then

  WeekVal[number] ”Low stress”

  OPtimalPlan(number-1, l, h, Value)

else

  WeekVal[number] ”High stress”

  OPtimalPlan(number-2, l, h, Value)

end if

return WeekVal

You might be interested in
Suzanne Brett wants to borrow $55,000 from the bank. The interest rate is 6.5% and the term is for 5 years.
Otrada [13]

Answer: $14575

$55000

6.5%

5 years

Total Payment Amount: $72875

Yearly payment :$72875/5= $14575

8 0
2 years ago
A jetliner flying at an altitude of 10,000 m has a Mach number of 0.5. If the jetliner has to drop down to 1000 m but still main
andreev551 [17]

Answer

Assuming

At 10000 m height temperature T = -55 C = 218 K

At 1000 m height temperature T = 0 C  = 273 K

\dfrac{V_1}{C_1} =\dfrac{V_2}{C_2} = 0.5

R = 287 J/kg K

C_1 = \sqrt{\gamma RT_1} = \sqrt{1.4\times 287\times 218} = 295 m/s

C_2 = \sqrt{\gamma RT_2} = \sqrt{1.4\times 287\times 273} = 331 m/s

V_2 = \dfrac{V_1}{C_1}\timesC_2

V₂ = V₁ ×1.1222

V₁ = 0.5 × C₁ = 0.5 × 295 = 147.5 m/s

V₂ = 1.1222 ×  147.5 = 165.49 m/s

so, the jetliner need to increase speed by ( V₂ -V₁  )

= 165.49 - 147.5

= 17.5 m/s

6 0
4 years ago
"Given a nodal delay of 84.1ms when there is no traffic on the network (i.e. usage = 0%), what is the effective delay when netwo
shtirl [24]

Answer:

Explanation:

effective delay = delay when no traffic x \frac{100}{100- network\r usage}

effective delay = 84.1 \times \frac{100}{100-39.3}=138.55024711697ms

4 0
3 years ago
An equation used to evaluate vacuum filtration is Q = ΔpA2 α(VRw + ARf) , Where Q ≐ L3/T is the filtrate volume flow rate, Δp ≐
larisa86 [58]

Answer:

Explanation:

The explanations and answers are shown in the following attachments

6 0
3 years ago
4) How much concrete was required to make the Hoover<br> Dam? Where did this concrete come from?
erica [24]
I’m not sure if this is right

4 0
4 years ago
Other questions:
  • True or False? Early engineers used a trial-and­error approach, rather than mathematical and scientific principles when solving
    14·1 answer
  • Name three major heat transfer mechanisms giving one example of each from day-to-day life. Also explain the physical mechanism b
    14·1 answer
  • A tailgate may have a latch on both sides.<br> O True<br> O False
    10·2 answers
  • When using a Hammer I should always keep an eye on may fingers so as not to hit them.?
    14·2 answers
  • QUESTION 6
    10·1 answer
  • Please help fast
    13·1 answer
  • What is the definition of a sheet metal tab?
    10·2 answers
  • For a Cu-Ni alloy containing 53 wt.% Ni and 47 wt.% Cu at 1300°C, calculate the wt.% of the alloy that is solid and wt.% of allo
    14·1 answer
  • A design that either partially or wholly integrates the bodywork
    6·1 answer
  • The operating sequence to light the main burners on an intermittent pilot system is:______.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!