You are on page 1of 6

ACSL Practice Short Problems Cathy Wu // 5/7/07

1. Simplify as much as possible:


B ( A( B  A)  C ( B  A)  C

2. Simplify as much as possible:


B ( A  B )  C ( B  C )  A(C  A)

3. Evaluate the following expression:


RSHIFT  3(( LCIRC  5(10010110110 AND10010110100))OR10101010101)

4. Evaluate the following expression:


LCIRC  2( RCIRC  2 111010 AND (011010 OR NOT 001101))

5. Solve for x:
BAD16  BAD16  x8
Wu

6. Express x as food item:


x  1 85  3 84  7 83  3 82  5 81  7 80

7. Find all ordered pairs which make the following circuit FALSE:
A

8. Rewrite the above circuit without using any ORs.


Wu
9. Write the adjacency matrix M1 for the following graph:
1 2

10. Determine x given the following statements, in reference to the above graph, G:
If G is connected, x is the sum of the number of edges and vertices. Otherwise, x is the remainder
of the number of edges divided by the number of vertices.

11. Translate the following infix equation into prefix:


 ABCD  BCE  2 5
0

12. Count the number of errors in this postfix equation:


ABCD BCE (0.5)   5 
Wu

13. In the following stack, determine the sum of the values popped:
PUSH (1), POP ( X ), PUSH (2), PUSH (3), PUSH (4), POP ( X ),
POP ( X ), PUSH (5), PUSH (6), POP ( X ), PUSH (7), PUSH (8)

14. In the following queue, determine the sum of the values popped:
PUSH (1), POP ( X ), PUSH (2), PUSH (3), PUSH (4), POP ( X ),
POP ( X ), PUSH (5), PUSH (6), POP ( X ), PUSH (7), PUSH (8)

15. Find the value of the following expression:


(CONS CAR(CDR ( REVERSE '(a b f g (c d e)))) ( purple and green))

16. Evaluate:
( EQ ( SQUARE ( DIV ( ADD ( MULT 4 5) 5) 5)) 5)
Wu
ACSL Practice Short Problems Solutions

1. B ( A( B  A)  C ( B  A)  C
B ( B  A)( A  C )  C
( B  AB )( A  C )  C
B A  0  BC  ABC  C
B ABC ABC  C
( B  A)( B  C )( A  B  C )  C
( B  AB  BC  AC )( A  B  C )  C
( B  AB  BC  AC ) A  ( B  AB  BC  AC ) B  ( B  AB  BC  AC )C  C
( B A  0  ABC  0)  ( B  AB  BC  ABC )  ( BC  ABC  0  0)  C
B A  ABC  B  AB  BC  ABC  BC  ABC  C
B ( A  AC  1  A  C  AC  C  AC )  C
B (1)  C
Ans: B  C
2. B ( A  B )  C ( B  C )  A(C  A)
B ( AB )  C ( BC )  A(C A)
Ans: 0
3. RSHIFT  3(( LCIRC  5(10010110110 AND10010110100))OR10101010101)
RSHIFT  3(( LCIRC  5(10010110100))OR10101010101)
RSHIFT  3((11010010010)OR10101010101)
RSHIFT  311111010111
Ans: 00011111010
4. LCIRC  2( RCIRC  2 111010 AND (011010 OR NOT 001101))
LCIRC  2(101110 AND (011010 OR 110010))
LCIRC  2(101110 AND 111010)
LCIRC  2 101010
Ans: 101010
5. BAD16  BAD16  x8
BAD (11)(10)(13)
 = 1(7)(5)(10) = 175A16
 BAD  (11)(10)(13)

175 A16  0001 0111 010110102  0 001 011101 011 0102  135328
Ans: x  135328
6. x  1 85  3 84  7 83  3 82  5 81  7 80
Food item? What?? Oh. Well, food items are generally spelled with letters, therefore base16.
x  1 85  3 84  7 83  3 82  5 81  7 80 = 1373578 = 1 011111 0111011112 = BEEF16
Ans: beef OR BEEF OR BEEF16
7. AB  B  0
Wu
( A  1) B  0
B0
Ans: (*, 0) or (1,0), (0,0)
8. Many possible solutions. One given here.
Ans:
B
 0 1 1 1
 0 0 0 1 
9. Ans: 
 0 0 0 0
 
 1 0 1 0
10. If G is connected, x is the sum of the number of edges and vertices. Otherwise, x is the remainder of
the number of edges divided by the number of vertices.
G is not connected. Therefore, x  E %V . E  6, V  4 . x  6%4  2
Ans: x  2
11.  ABCD  BCE   0 2 5

 A B C D  B C E  2   5  0
Ans:   ABCD BC  E 2 5 0
12. ABCD BCE (0.5)   5 
- (0.5) is not valid for 1/2. Must use (12/) instead.
- Missing the equals sign; required for equations.
- Missing values on the other side of the missing equals sign.
Ans: 3
PUSH (1), POP ( X ), PUSH (2), PUSH (3), PUSH (4), POP ( X ),
13. Stack
POP ( X ), PUSH (5), PUSH (6), POP ( X ), PUSH (7), PUSH (8)
Popped: 1, 4, 3, 6
Sum: 1+4+3+6=14
Ans: 14
PUSH (1), POP ( X ), PUSH (2), PUSH (3), PUSH (4), POP ( X ),
14. Queue
POP ( X ), PUSH (5), PUSH (6), POP ( X ), PUSH (7), PUSH (8)
Popped: 1, 2, 3,4
Sum: 1+2+3+4=10
Ans: 10
15. (CONS CAR(CDR ( REVERSE '(a b f g (c d e)))) ( purple and green))
(CONS CAR(CDR ( (c d e) g f b a)) ( purple and green))
(CONS CAR( g f b a ) ( purple and green))
(CONS ( g ) ( purple and green))
Ans: ( g purple and green)
16. ( EQ ( SQUARE ( DIV ( ADD ( MULT 4 5) 5) 5)) 5)
( EQ ( SQUARE ( DIV ( ADD 20 5) 5)) 5)
( EQ ( SQUARE ( DIV 25 5)) 5)
( EQ ( SQUARE 5) 5)
( EQ 25 5)
Ans: NIL

You might also like