Last updated at October 28, 2026 by Teachoo
Transcript
Greater than as an Algorithm Algorithm To bro asd Here, we take Greater than – and write it as an algorithm As an example, we check Which is greater: 7 or 4? We follow these steps ALGORITHMS: THE BIG PICTURE An algorithm is a precise, step-by-step procedure for solving a problem. One tiny problem: which number is greater? START WITH A SIMPLE METHOD Subtract 1 from both numbers until either reaches zero. (7, 4) | > (6; 3) | > |G, 2)| > | (4D) > |G, 0) The second number reached zero first. So 7 > 4. 2) WRITE COMPLETE INSTRUCTIONS If both reach zero together, the original Input: 7 and 4. Repeat: subtract 1 from each. t h numbers were equal. Stop: when either is zero. Clecletareero Output: greater, smaller or equal. before subtracting. cer TRACK OF INFORMATION Lists organise values in order: 32 can be stored as [3, 2]. A list is a data structure. Variables name changing values: W711 As 4) EXPLAIN WHY IT WORKS Removing the same amount from 7-4=3 both numbers preserves their difference. 6-3=3 The smaller value decreases to zero, so the method stops. © sk: How MucH WORK? — ess Comparing 999 and 998 by counting e down takes 998 rounds. ‘ih Correct does not always mean efficient. 998 IMPROVE THE METHOD For whole numbers written without extra leading zeros: 1 More digits means greater: 100 > 99. 2 Same length? Compare from the left: 32 > 29 because 3 tens > 2 tens. 3. All digits match? The numbers are equal. Why it works: the first unequal place outweighs every place to its right. 999 vs 998: only 3 digit cemparisons once lengths are known. 7) CONNECT IT TO THE CHAPTER Addition: count objects > add digits HCF: list divisors > keep only using place value. what is needed — subtract > use remainders. Precise steps. Correct answer. Less work. Algorithm To bro asd ALGORITHMS: THE BIG PICTURE An algorithm is a precise, step-by-step procedure for solving a problem. One tiny problem: which number is greater? START WITH A SIMPLE METHOD Subtract 1 from both numbers until either reaches zero. (7, 4) | > (6; 3) | > |G, 2)| > | (4D) > |G, 0) The second number reached zero first. So 7 > 4. 2) WRITE COMPLETE INSTRUCTIONS If both reach zero together, the original Input: 7 and 4. Repeat: subtract 1 from each. t h numbers were equal. Stop: when either is zero. Clecletareero Output: greater, smaller or equal. before subtracting. cer TRACK OF INFORMATION Lists organise values in order: 32 can be stored as [3, 2]. A list is a data structure. Variables name changing values: W711 As 4) EXPLAIN WHY IT WORKS Removing the same amount from 7-4=3 both numbers preserves their difference. 6-3=3 The smaller value decreases to zero, so the method stops. © sk: How MucH WORK? — ess Comparing 999 and 998 by counting e down takes 998 rounds. ‘ih Correct does not always mean efficient. 998 IMPROVE THE METHOD For whole numbers written without extra leading zeros: 1 More digits means greater: 100 > 99. 2 Same length? Compare from the left: 32 > 29 because 3 tens > 2 tens. 3. All digits match? The numbers are equal. Why it works: the first unequal place outweighs every place to its right. 999 vs 998: only 3 digit cemparisons once lengths are known. 7) CONNECT IT TO THE CHAPTER Addition: count objects > add digits HCF: list divisors > keep only using place value. what is needed — subtract > use remainders. Precise steps. Correct answer. Less work. Algorithm To bro asd ALGORITHMS: THE BIG PICTURE An algorithm is a precise, step-by-step procedure for solving a problem. One tiny problem: which number is greater? START WITH A SIMPLE METHOD Subtract 1 from both numbers until either reaches zero. (7, 4) | > (6; 3) | > |G, 2)| > | (4D) > |G, 0) The second number reached zero first. So 7 > 4. 2) WRITE COMPLETE INSTRUCTIONS If both reach zero together, the original Input: 7 and 4. Repeat: subtract 1 from each. t h numbers were equal. Stop: when either is zero. Clecletareero Output: greater, smaller or equal. before subtracting. cer TRACK OF INFORMATION Lists organise values in order: 32 can be stored as [3, 2]. A list is a data structure. Variables name changing values: W711 As 4) EXPLAIN WHY IT WORKS Removing the same amount from 7-4=3 both numbers preserves their difference. 6-3=3 The smaller value decreases to zero, so the method stops. © sk: How MucH WORK? — ess Comparing 999 and 998 by counting e down takes 998 rounds. ‘ih Correct does not always mean efficient. 998 IMPROVE THE METHOD For whole numbers written without extra leading zeros: 1 More digits means greater: 100 > 99. 2 Same length? Compare from the left: 32 > 29 because 3 tens > 2 tens. 3. All digits match? The numbers are equal. Why it works: the first unequal place outweighs every place to its right. 999 vs 998: only 3 digit cemparisons once lengths are known. 7) CONNECT IT TO THE CHAPTER Addition: count objects > add digits HCF: list divisors > keep only using place value. what is needed — subtract > use remainders. Precise steps. Correct answer. Less work. Algorithm An algorithm is a precise, step-by-step procedure for solving a problem. For example - This is an algorithm for finding the larger of two numbers: Take two numbers, a and b If a > b, report a Otherwise, report b If the numbers are 17 and 23, following the procedure gives 23 An algorithm usually has: Algorithm To bro asd