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>
![Sum = x + y](https://tex.z-dn.net/?f=Sum%20%3D%20x%20%2B%20y)
<u>Step 5: Multiply Sum by 10</u>
![Result = Sum \times 10](https://tex.z-dn.net/?f=Result%20%3D%20%20Sum%20%5Ctimes%2010)
<u>Step 6: Divide by 2</u>
![Result = Sum \times 10 \div 2](https://tex.z-dn.net/?f=Result%20%3D%20%20Sum%20%5Ctimes%2010%20%5Cdiv%202)
![Result = Sum \times 5](https://tex.z-dn.net/?f=Result%20%3D%20%20Sum%20%5Ctimes%205)
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 ![Result = Sum \times 5](https://tex.z-dn.net/?f=Result%20%3D%20%20Sum%20%5Ctimes%205)
![Sum = \frac{Result}{5}](https://tex.z-dn.net/?f=Sum%20%3D%20%5Cfrac%7BResult%7D%7B5%7D)
When 10, 20, 30, 40, 50 and 60 are divided by 5, the result is:
![Sum = 2, 4,6,8,10, 12](https://tex.z-dn.net/?f=Sum%20%3D%202%2C%204%2C6%2C8%2C10%2C%2012)
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:
![Sum = 1,3,5,7](https://tex.z-dn.net/?f=Sum%20%3D%201%2C3%2C5%2C7)
It is not possible to have a sum of 1 for two rolls
So, we have:
![Sum = 3,5,7](https://tex.z-dn.net/?f=Sum%20%3D%203%2C5%2C7)
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