0% found this document useful (0 votes)
31 views6 pages

2020 JR Shorts Solution

Uploaded by

scribd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views6 pages

2020 JR Shorts Solution

Uploaded by

scribd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

American Computer Science League

2019-2020 ACSL Finals


Junior Shorts Solutions

1. Boolean Algebra

1. 0 (A)

2. Boolean Algebra
​First
A$B+( $ B) ( $ )

2. 4 (D)

This is always TRUE.

3. Bit-String Flicking
​ (RSHIFT-2 (LCIRC-1 (NOT 0111001))) AND
(NOT (RCIRC-2 (LSHIFT-1 1100011)))
= (RSHIFT-2 (LCIRC-1 1000110)) AND
(NOT (RCIRC-2 1000110))
3. 0000010 (C)
= (RSHIFT-2 0001101) AND (NOT 1010001)
= 0000011 AND 0101110
= 0000010
4. Bit-String Flicking
Let X = abcde and NOT X = ABCDE
LHS = (LCIRC-2 01010) OR (RSHIFT-1 ((LCIRC-2 abcde)
AND 01110))

= 01001 OR (RSHIFT-1 ( cdeab AND 01110))

= ( 01001 OR (RSHIFT-1 0dea0)

= 01001 OR 00dea 4. 8 (C)

= 01de1

LHS = RHS → 01de1 = 01101

→ d = 1, e = 0, a = *, b = *, c = *

→ b = 1, c = 1, e = 1 → a = *, d = *

Therefore X = abcde = ***10 8 solutions

5. Recursive Functions

5. 380 (D)

6. Recursive Functions

6. 44 (C)
7. Digital Electronics
​The digital circuit translates to:

7. 001 (D)

8. Digital Electronics
​The circuit translates to:

(A)( (A, B, C)) + ((( (A, B, C)) + C)

Let X = (A, B, C).


The expression is now: A X + (X + C)

A B C X AX X+C AX + (X+C)

0 0 0 0 0 0 0

0 0 1 1 0 1 1 8. 6 (D)

0 1 0 1 0 1 1

0 1 1 0 0 1 1

1 0 0 1 1 1 1

1 0 1 0 0 1 1

1 1 0 0 0 0 0

1 1 1 0 0 1 1

Therefore there are 6 triples that make the expression TRUE.

9. Prefix-Infix-Postfix
- %-+2^324*+/84$20//+82$25%-38
= - % - + 2 (^ 3 2) 4 * + (/ 8 4) ($ 2 0) / / (+ 8 2) ($ 2 5) % (- 3 8)
= - % - (+ 2 9) 4 * (+ 2 0) / (/ 10 2) (% (- 5)) 9. 5 (B)
= - % (- 11 4) * 2 ( / 5 5)
= - (% 7) (* 2 1)
= -7 2=5
10. Prefix-Infix-Postfix
If A = 5, B = 3, and C = 2:
ABC+/BC^^BA+CB^/A*+
​ = 532+/32^^35+23^/5*+
= 5 (3 2 +) / (3 2 ^) ^ (3 5 +) ( 2 3 ^) / 5 * + 10. 6 (A)
= (5 5 /) 9 ^ ( 8 8 /) 5 * +
​ = (1 9 ^) (1 5 *) +
= ​1 5 +
= 6

11. Computer Number Systems

20208 − 2028 − 208 + 28 = 16008


Convert each bit to binary: 001 110 000 000 11 380 (C)

Group 4 at a time: 0011 1000 0000


Convert to hex: 3 8 0

12. Computer Number Systems


​Change each to its binary representation:

​50: 110010 55: 110111 60: 111100


51: 110011 56: 111000 61: 111101
52: 110100 57: 111001 62: 111110 12. 60 (B)

53: 110101 58: 111010 63: 111111


54: 110110 59: 111011 64: 1000000

Therefore there are 60 1’s.

13. Data Structures

​The stack is constructed using LIFO as follows:


​ ​G, GE, GER, GERB, GER​B​, GE​R​, GEE, GE​E​, GER, GERA, 13. R (D)
GERAD, GERA​D​, GERAA, GERAAI, GERAA​I​, GERA​A​,
GERAS, GERASY, GERAS​Y​, GERA​S​, GER​A
The next item popped would be R.
14. Data Structures
​The binary search tree for SOCIALDISTANCING is:

14. 7 (D)

It has a depth of 7 since the root node has depth 0.

15. Graph Theory

The graph that the adjacency matrix represents is:

15. 5 (C)

The cycles are: AA, ACDA, ADA, CC, and CDC.

16. Graph Theoryoio

16. 13 (D)

By adding the entries in the squared matrix you get 13 paths of length 2.
17. What Does This Program Do?
This program counts the number of increasing factors of 2020 that sum to
less than 2020. They are 1, 2, 4, 5, 10, 20, 101, 202, 404 and 505. 17. 10 (C)

18. What Does This Program Do?


This program matches the letters in each string and sums the product of
their locations.

Matching Letter Position in A Position in B Sum

C 0 0 0
18. 37 (B)
O 1 1 1

O 3 1 4

V 6 2 16

I 7 3 37

19. What Does This Program Do?


This program adds all the entries in the array (352), then finds the average
(39). It counts the entries in the first half that are less than the average (19, 19. 5 (C)
21) and the entries in the upper half that are greater than the average (33,
11) and the middle entry (28). There are 5.

20. What Does This Program Do?


​This program finds the sum of specific input locations from 1 to 15.

N V R C A(R,C) S

1 4 0 4 1 1

2 8 1 3 3 4
20. 18 (A)
3 11 2 1 2 6

4 2 0 2 2 8

5 5 1 0 4 12

6 13 2 4 1 13

7 6 1 1 5 18

You might also like