Smaller files, smarter gates
Answers are for parents and teachers.
1
Compress this list by writing each item and its positions: yes, no, no, yes, no, yes.
yes: 1, 4, 6. no: 2, 3, 5.
2
Rebuild this data: tick at 2, 4; tock at 1, 3, 5.
tock, tick, tock, tick, tock.
3
Write the truth tables for NOT and AND.
NOT: 0 → 1, 1 → 0. AND: 00 → 0; 01 → 0; 10 → 0; 11 → 1.
4
A room light is on when it is dark AND someone is in the room. Which gate? Write its truth table.
An AND gate. Output is 1 only for dark = 1 and someone = 1; the other three rows are 0.
5
What does print(not True or True) print? Work it out step by step.
True. not True is False; False or True is True.