Originally Posted by

**Plato** Suppose that

then you need two functions such that

.

That would mean that

.

How many pairs

have those properties?

Thank you once more. If I understand correctly, if , then there are three possibilities for the ordered pairs . As each of the two unmapped inputs in f and g must then be mapped to one of three possible outputs, there are 3(3^2)(3^2) = 3^5 = 243 pairs that have the desired properties. A small Python program I wrote agrees:

Code:

def test_functions(functions):
for f in functions:
for g in functions:
if f[g[1]] == 3:
print f, g, f[g[1]]
def make_functions():
functions = []
for i in range(1, 4):
for j in range(1, 4):
for k in range(1, 4):
functions.append({1: i, 2: j, 3: k})
return functions
test_functions(make_functions())