You will write a tester that decides whether a statement is a tautology and whether two statements are equivalent. Then you use it on a switching circuit.
The idea. A tautology is true in every row. Two statements are equivalent when they agree in every row. A circuit with switches in series is an "and"; in parallel it is an "or".
Your tasks.
is_tautology(f, n). Return True when f is true in every row.equivalent(f, g, n). Return True when f and g agree in every row.circuit(p, q, r). It is the circuit with in series with a block of and in parallel. Return whether the lamp glows.Run your code once to unlock the worked solution.
Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…