0
$\begingroup$

Suppose this set:

$S = \{A, B, C, D\}$

and

$S\times S = \{AA, AB, AC, AD, BA, BB, BC, BD, CA, CB, CC, CD, DA, DB, DC, DD\}$

I want a function such that: $f(P) = p$

where $P \in S \times S$ and $p \in [0, 16)$ and $f(P)$ is a one-to-one. Lastly, $f(P)$ needs to be some sort of calculation, not an arbitrary mapping.

How can I do this (you can assign number values to elements in $S$)?

  • 3
    What about something like treating A, B, C, and D as digits in base 4?2017-01-30
  • 0
    Could be more explicit please?2017-01-30
  • 1
    @Lucrecious Consider $S=\{0,1,2,3\}$ and let $f(x,y)=4x+y$.2017-01-30

0 Answers 0