Q 7: What is the number of `Hello's printed by the pseudo code below? (for i from lo to hi

exhaust i between lo and hi inclusive, and is a empty loop when lo is greater than hi)
(b) for i from 1 to 10
for j from i to 10
for k from i to j
print `Hello'

To determine the number of `Hello's printed by the given pseudo code, we need to analyze the nested loops and understand how the variables change during the execution.

The pseudo code consists of three nested loops. Let's break it down and determine the number of iterations for each loop.

1. The outermost loop: "for i from 1 to 10"
This loop will be executed 10 times, with the variable i taking on values from 1 to 10.

2. The second loop: "for j from i to 10"
This loop depends on the value of i from the outer loop. For each iteration of the outer loop, the inner loop will be executed 10 minus the current value of i plus 1 times. This is because the loop condition specifies that j should start from i and go up to 10. Therefore, j will take on values such as i, i + 1, i + 2, ..., 9, 10.

3. The innermost loop: "for k from i to j"
Similar to the previous loop, the number of iterations will depend on the values of i and j. For each combination of i and j, k will take on values from i to j. This means that the innermost loop will be executed j - i + 1 times.

To determine the total number of `Hello's printed, we need to calculate the number of iterations for the innermost loop and multiply it by the number of iterations for the second loop, which in turn needs to be multiplied by the number of iterations for the outer loop.

Let's calculate this:

For each iteration of the outer loop:
- The second loop will run (10 - i + 1) times.
- The innermost loop will run (j - i + 1) times, where j is the current value of the second loop.

So, the total number of `Hello's printed can be calculated as follows:

Total count = Sum [(10 - i + 1) * Sum [(j - i + 1)]]

Now, we can proceed with the calculation:

Count = (10 - 1 + 1) * (10 - 1 + 1) + (10 - 2 + 1) * (10 - 2 + 1) + . . . + (10 - 10 + 1) * (10 - 10 + 1)

Count = 10^2 + 9^2 + 8^2 + . . . + 1^2

To simplify the calculation, we can use the formula for the sum of squares:

Sum[(1^2 + 2^2 + . . . + n^2)] = n * (n + 1) * (2n + 1) / 6

Now, let's substitute n with 10:

Count = (10 * 11 * 21) / 6

Count = 385

Therefore, the total number of `Hello's printed by the given pseudo code is 385.