Math Problem Statement

Now Carl wants to improve Sunrise Baskets’s demand forecast. After working with historical data, he is confident the algorithm presented below can provide a reasonable forecast for day 8, based on how many baskets were sold in the previous 7 days (Table 2) Inputs: L = array of N integer variables v(i) = value of the ith variable in the list Algorithm: step 1: set max=0, i=1 and forecast = 0 step 2: select item i in the list step 3: if v(i) > max, then set max = v(i) step 4: if i<N, then set i=i+1 and go to step 2, otherwise go to step 5 step 5: forecast = (max + v(i))/2 end Output: forecast Table 2. Baskets sold in the previous 7 days Day (i) 1 2 3 4 5 6 7 Baskets sold (v(i)) 22 20 21 34 23 17 14 If he applies the algorithm to the data found in Table 2, Assume now that step 3 no longer exists in the algorithm described above, what is the value of “forecast” at the end of the algorithm?

Solution

Ask a new question for Free

By Image

Drop file here or Click Here to upload

Math Problem Analysis

Mathematical Concepts

Algorithm
Iteration
Average

Formulas

-

Theorems

-

Suitable Grade Level

Grades 9-12