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
Ivahew [28]
3 years ago
5

MODIFIED-BOTTOM-UP-CUT-ROD(p, n, c) to return not only the value but the actual solution, too. Hint: It is similar to how array

s is maintained in EXTENDED-BOTTOM-UP-CUT-ROD. Now you need to initialize not just array r but also array s in EXTENDED-MEMOIZED-1 let r[0..n] and s[0..n] be new arrays2 r[0] = 03 for j = 1 to n4 q = p[ j ]5 s[ j ] = j6 for i = 1 to j - 17 if q < p[ i ]+ r[ j - i ] - c8 q = p[ i ]+ r[ j - i ] - c9 s[ j ] = i10 r[ j ] = q11 return r and s3
Engineering
1 answer:
Vaselesa [24]3 years ago
8 0

Answer:

b.

Matrix chain multiplication

M[i,j] = M[i,k] + M[(k+1),j] + p[i-1]*p[k]*p[j] i<=k<j

p[] = {5,10,3,12,5,50}

M[0][0] = 0,M[1][1] = 0,M[2][2] = 0,M[3][3] = 0,M[4][4] = 0,M[5][5] = 0,

M[1][2] = M[1][1]+M[2][2]+p[0]*p[1]*p[2] = 0+0+5*10*3 = 150

M[2][3] = M[3][3]+M[2][2]+p[1]*p[2]*p[3] = 0+0+10*3*12 = 360

M[3][4] = M[3][3]+M[4][4]+p[2]*p[3]*p[4] = 0+0+3*12*5 = 180

M[4][5] = M[4][4]+M[5][5]+p[3]*p[4]*p[5] = 0+0+12*5*50 = 3000

M[1][3] = min{M[1][1]+M[2][3]+p[0]*p[1]*p[3] , M[1][2]+M[3][3]+p[0]*p[2]*p[3]}

= {0 + 360 + 600 , 150+0+180} = {960,330} = 330

M[2][4] = min{M[2][2]+M[3][4]+p[1]*p[2]*p[4] , M[2][3]+M[4][4]+p[1]*p[3]*p[4]}

= {0 + 180 + 150 , 360+0+600} = {960,330} = 330

M[3][5] = min{M[3][3]+M[4][5]+p[2]*p[3]*p[5] , M[3][4]+M[5][5]+p[2]*p[4]*p[5]}

= {0 + 3000 + 1800 , 180+0+750} = {4800,930} = 930

M[1][4] = min{M[1][1] + M[2][4] +p[0]*p[1]*p[4] ,M[1][2] + M[3][4] +p[0]*p[2]*p[4] ,

M[1][3] + M[4][4] +p[0]*p[3]*p[4]}

{0+330+250 , 150+180+75 , 330+0+300} = 405

M[2][5] = min{M[2][2] + M[3][5] +p[1]*p[2]*p[5] ,M[2][3] + M[4][5] +p[1]*p[3]*p[5] ,

M[2][4] + M[5][5] +p[1]*p[4]*p[5]}

{0+930+1500 , 360+3000+6000,330+0+2500} = 2430

M[1][5] = min{M[1][1] +M[2][5]+p[0]*p[1]*p[5] , M[1][2] +M[3][5]+p[0]*p[2]*p[5],

M[1][3] +M[4][5]+p[0]*p[3]*p[5] , M[1][4] +M[5][5]+p[0]*p[4]*p[5]}

{0+2430+2500 , 150+930+750 , 330+3000+3000 , 405+0+1250} = 1655

(a)

MemoizedCutRod(p, n)

r: array(0..n) := (0 => 0, others =>MinInt)

return MemoizedCutRodAux(p, n, r)

MemoizedCutRodAux(p, n, r)

if r(n) = 0 and then n /= 0 then -- check if need to calculate a new solution

q: int := MinInt

for i in 1 .. n loop

q := max(q, p(i) + MemoizedCutRodAux(p, n-i, r))

end loop

end if

r(n) := q

end if

return r(n)

You might be interested in
View the picture below and then correctly answer the questions using the following words: Temperate Zone, Tropical Zone, Polar Z
Nadusha1986 [10]

Can you provide the picture? Thanks !

8 0
3 years ago
Read 2 more answers
A Wii remote flung from a hand through a TV, with a kinetic energy of 1.44J and a mass of 4.5kg. Whats the velocity?
Eva8 [605]

Answer:

0.8

Explanation:

7 0
3 years ago
To measure the greening of the U.S. economy, you need only to look at the growing number of green jobs and occupations.
puteri [66]

Answer is True.. hope I helped... pls mark brainliest

6 0
3 years ago
Read 2 more answers
A displacement transducer has the following specifications: Linearity error ± 0.25% reading Drift ± 0.05%/○C reading Sensitivity
White raven [17]

Answer:

The Estimated uncertainty in a nominal displacement of 2 cm at the design stage is plus or minus 0.0124cm

Explanation:

uncertainty in a nominal displacement

= (u^2 + v^2)^(1/2)

assume from specifications that k = 5v/5cm

                                                         = 1v/cm

u^2 = (0.0025*2)^(2) + (0.005*10*2)^2 + (0.0025*2)^2

      = 0.01225v

v = 2v * 0.001

  = 0.002v

uncertainty in a nominal displacement

= (u^2 + v^2)^(1/2)

= ((0.01225)^2 + (0.002)^2)^(1/2)

= 0.0124 cm

Therefore, The Estimated uncertainty in a nominal displacement of 2 cm at the design stage is plus or minus 0.0124cm

8 0
3 years ago
1. Under what conditions can soils be chemically stabilized?
marshall27 [118]

Answer:

All will be Explained below.

Explanation:

1) Under which Condition can a soil be chemically Stabilize.

Answer

a). Plasticity Index :A soil with a high value of plasticity Index is not good for various engineering projects. The introduction of line helps in reducing plasticity due cation exchange reaction.Pozzolanic reaction over time reduces plasticity and increase index strength due to the formation of calcium - silicate hydrate.

7 0
4 years ago
Other questions:
  • Make sure that the switch is on (if the drill is electric), the chuck key is not removed before you plug in the drill or turn it
    11·2 answers
  • An analog baseband audio signal with a bandwidth of 4kHz is transmitted through a transmission channel with additive white noise
    14·1 answer
  • 4. At what temperature does an engine run cleanest with least wear?
    11·1 answer
  • The radial component of acceleration of a particle moving in a circular path is always:________ a. negative. b. directed towards
    9·1 answer
  • Which of the following is a direct result of technological improvements in the music industry?
    9·2 answers
  • Steam in a heating system flows through tubes whose outer diameter is 5 cm and whose walls are maintained at a temperature of 19
    13·1 answer
  • 12. Never spray brakes with a high-pressure stream of water or air because it could blow asbestos fibers into the air.
    8·1 answer
  • PLEASE FIX THIS LUA SCRIPT
    12·2 answers
  • If a condenser has high head pressure and a higher than normal temperature, a technician could ____.
    7·1 answer
  • How to engineering equation solving
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!