Computational Thinking (CO2412) Tutorial 4.2: Week 18

4.2 Create a statement that becomes False for n valuations

Develop an algorithm and implement a function that solves the following problem: The argument is n, a natural number. The desired return value is a propositional logic statement, as a Propositional object, that has a truth table with n False entries. It does not matter for what exact valuations the statement becomes False, only that this occurs for a total of n valuations.

Validate your function by testing it for a few values of n.

Determine the asymptotic time efficiency and the asymptotic space efficiency of your algorithm (in Landau "big O" notation, as usual). Do you reckon that you have reached the best possible asymptotic efficiency?

Remark: The propositional logic statements notebook has been updated slightly to support this work: The Propositional class now includes a method num_false_in_truth_table() that returns the number of False entries in the truth table, and at the end of the notebook, there is a function natural_number_to_binary_list(n) that translates a natural number into a list containing its representation as binary digits.

Submission deadline: 26th February 2022; discussion planned for 15th March 2022. Group work by up to four people is welcome.