Puzzles
Odd and even outputs
Let \(g:\mathbb{N}\times\mathbb{N}\rightarrow\mathbb{N}\) be a function.
This means that \(g\) takes two natural number inputs and gives one natural number output. For example if \(g\) is defined by \(g(n,m)=n+m\) then \(g(3,4)=7\) and \(g(10,2)=12\).
The function \(g(n,m)=n+m\) will give an even output if \(n\) and \(m\) are both odd or both even and an odd output if one is odd and the other is even. This could be summarised in the following table:
| \(n\) |
odd | even |
\(m\) | odd | even | odd |
e | odd | even |
Using only \(+\) and \(\times\), can you construct functions \(g(n,m)\) which give the following output tables:
| \(n\) |
odd | even |
\(m\) | odd | odd | odd |
e | odd | odd |
|
| \(n\) |
odd | even |
\(m\) | odd | odd | odd |
e | odd | even |
|
| \(n\) |
odd | even |
\(m\) | odd | odd | odd |
e | even | odd |
|
| \(n\) |
odd | even |
\(m\) | odd | odd | odd |
e | even | even |
|
| \(n\) |
odd | even |
\(m\) | odd | odd | even |
e | odd | odd |
|
| \(n\) |
odd | even |
\(m\) | odd | odd | even |
e | odd | even |
|
| \(n\) |
odd | even |
\(m\) | odd | odd | even |
e | even | odd |
|
| \(n\) |
odd | even |
\(m\) | odd | odd | even |
e | even | even |
|
| \(n\) |
odd | even |
\(m\) | odd | even | odd |
e | odd | odd |
|
| \(n\) |
odd | even |
\(m\) | odd | even | odd |
e | odd | even |
|
| \(n\) |
odd | even |
\(m\) | odd | even | odd |
e | even | odd |
|
| \(n\) |
odd | even |
\(m\) | odd | even | odd |
e | even | even |
|
| \(n\) |
odd | even |
\(m\) | odd | even | even |
e | odd | odd |
|
| \(n\) |
odd | even |
\(m\) | odd | even | even |
e | odd | even |
|
| \(n\) |
odd | even |
\(m\) | odd | even | even |
e | even | odd |
|
| \(n\) |
odd | even |
\(m\) | odd | even | even |
e | even | even |
|
Show answer & extension
Hide answer & extension
| \(n\) |
odd | even |
\(m\) | odd | odd | odd |
e | odd | odd |
\(g(n,m)=1\)
| \(n\) |
odd | even |
\(m\) | odd | odd | odd |
e | odd | even |
\(g(n,m)=n\times m + n + m\)
| \(n\) |
odd | even |
\(m\) | odd | odd | odd |
e | even | odd |
\(g(n,m)=n\times m +n+1\)
| \(n\) |
odd | even |
\(m\) | odd | odd | odd |
e | even | even |
\(g(n,m)=m\)
| \(n\) |
odd | even |
\(m\) | odd | odd | even |
e | odd | odd |
\(g(n,m)=n\times m+m+1\)
| \(n\) |
odd | even |
\(m\) | odd | odd | even |
e | odd | even |
\(g(n,m)=n\)
| \(n\) |
odd | even |
\(m\) | odd | odd | even |
e | even | odd |
\(g(n,m)=n+m+1\)
| \(n\) |
odd | even |
\(m\) | odd | odd | even |
e | even | even |
\(g(n,m)=n\times m\)
|
| \(n\) |
odd | even |
\(m\) | odd | even | odd |
e | odd | odd |
\(g(n,m)=n\times m+1\)
| \(n\) |
odd | even |
\(m\) | odd | even | odd |
e | odd | even |
\(g(n,m)=n+m\)
| \(n\) |
odd | even |
\(m\) | odd | even | odd |
e | even | odd |
\(g(n,m)=n+1\)
| \(n\) |
odd | even |
\(m\) | odd | even | odd |
e | even | even |
\(g(n,m)=n\times m+n\)
|
| \(n\) |
odd | even |
\(m\) | odd | even | even |
e | odd | odd |
\(g(n,m)=m+1\)
| \(n\) |
odd | even |
\(m\) | odd | even | even |
e | odd | even |
\(g(n,m)=n\times m+n\)
| \(n\) |
odd | even |
\(m\) | odd | even | even |
e | even | odd |
\(g(n,m)=n\times m+n+m+1\)
| \(n\) |
odd | even |
\(m\) | odd | even | even |
e | even | even |
\(g(n,m)=2\)
ExtensionCan you find functions \(h:\mathbb{N}\times\mathbb{N}\times\mathbb{N}\rightarrow\mathbb{N}\) (call the inputs \(n\), \(m\) and \(l\)) to give the following outputs:
\(l\) odd
| \(n\) |
odd | even |
\(m\) | odd | even | even |
e | even | even |
|
\(l\) even
| \(n\) |
odd | even |
\(m\) | odd | even | even |
e | even | even |
|
\(l\) odd
| \(n\) |
odd | even |
\(m\) | odd | even | even |
e | even | even |
|
\(l\) even
| \(n\) |
odd | even |
\(m\) | odd | even | even |
e | even | odd |
|
etc
|