Algorithms are used to simulate real programs.
The true conditions of the algorithm are:
- <em>(a) If the value found in step 6 is 10, 20, 30, 40, 50 or 60 then the sum is even
</em>
- <em>(b) If the last digit of the value found in step 6 is 5, then the sum is odd</em>
First, we analyze the algorithm.
Assume the outcomes of the two rolls are x and y
<u>Step 4: Calculate sum</u>
<u>Step 5: Multiply Sum by 10</u>
<u>Step 6: Divide by 2</u>
This means that, the algorithm simply multiplies the sum of the rolls by 5
<u>Option (a): If step 6 is 10, 20, 30, 40, 50 or 60, then sum is even</u>
Make Sum the subject in
When 10, 20, 30, 40, 50 and 60 are divided by 5, the result is:
All the above numbers are even number.
This means that, the sum is an even number.
<em>Hence, (a) is true</em>
<u>Option (b): If the last digit of step 6 is 5, then the sum is Odd.</u>
The possible sum of two rolls of dice, where the last digit ends in 5 are:
5, 15, 25, 35
When each of these are divided by 5, the result is:
It is not possible to have a sum of 1 for two rolls
So, we have:
All the above numbers are odd.
This means that, the sum is an odd number.
<em>Hence, (b) is true</em>
So, we can conclude that the true conditions are:
(a) and (b)
Read more about algorithms at:
brainly.com/question/17780739