The functions I was looking at were invertible, so if there was a function

**, then there had to exist another function**

*f*(a, b)**such that**

*g*(a, c)**. In this case, all values are drawn from the set**

*g*(a,*f*(a, b)) = b**N**.

Because of the invertibility requirement, we can say that any function

**is a permutation of**

*f*(b) =_{a}*f*(a, b)**|N|**values, so the number of distinct functions

*is*

**f**_{a}**|N|!**. If we think of

**as selecting a function**

*f*(a, b)*from a table of values using the index*

**f**_{a}**a**and applying that function to the value

**b**, then the number of distinct tables of

**|N|**functions drawn from a set of size

**|N|!**is

**(|N|!)**.

^{|N|}That means for

**|N| = 4**, for example, I needed to check

**(4!)**

^{4}**= 331776**functions for those that had the additional commutative property I was looking for.

In order to check all of the functions exhaustively, I came up with a 1:1 relationship between every number in [0..331775] and every function in the set. Then I iterated through each number, generated the function from the number, and tested the function for the property I was looking for.

But parenting duties call again, so I'll have to finish this later.

## No comments:

## Post a Comment