Suppose we have a 3-qubit input; each bit is either 0 or 1. How to decide if there are more 1's than 0's? (OnlyOnly 1 extra qubit and single/double qubit gatesmay be used for the output. (Yes I know this can be used; you cannot use toffoliachieved using 3 Toffoli gates, nor construct the toffoli gate using single/double qubitbut can it be done without Toffoli gates?)
Now suppose we have an answer to the above question, then, how to extend the above circuit to deal with a 5-qubit input?