2 Junior
2 Junior
2018-2019 Contest #2
JUNIOR DIVISION
1. Pre/Post/Infix Notation 1.
Evaluate this prefix expression given all numbers are single digits.
+−/*2+354/9−↑221/+*35*62↑32
2. Pre/Post/Infix Notation 2.
3. Bit-String Flicking 3.
4. Bit-String Flicking 4.
1. Pre/Post/Infix Notation 1. 4
+−/*2+354/9−↑221/+*35*62↑32
= + − / * 2 (+ 3 5) 4 / 9 − (↑ 2 2) 1 / + (* 3 5) (* 6 2) (↑ 3 2)
= + − / (* 2 8) 4 / 9 (− 4 1) / (+ 15 12) 9
= + − (/ 16 4) (/ 9 3) (/ 27 9)
= + (− 4 3) 3 = + 1 3 = 4
The i loop gives the variable a values of 1, 5, 14, 30, 55 by adding the
squares. The j loop gives the variable c values of 10, 30, 60, 100, 150
by adding 5 times the value of j. Going into the k loop, a = 55, b = 5,
c = 150 and d = 25. This loop counts the factors of these numbers from
2 to 25. There are 12 factors. a : 5, 11 b: 5
c: 2, 3, 5, 6, 10, 15, 25 d: 5, 25