2
$\begingroup$

Sorry to edit this so much at this late stage, but the question and answers are confused so much by my incorrect use of terminology and the such, I feel that I should clear this up.


Where $a$ and $b$ are lists.

$a = \{\mathbf{true, false, true, false, false}\}$ $b = f(a) = \{0.8, 0, 0.8, 0, 0\}$

In this case each $\bf true$ in $a$ has become a $0.8$ in $b$, as with $\bf false$ and $0$.

What is $f$?

  • 0
    Then you should edit your question to make it clear what you want *exactly*. If it's image, then my comment already answers your question (and I will $p$ost it as an answer so that you can accept it).2012-08-21

2 Answers 2

1

First, note that you are working with multisets rather than sets, since you are allowing repeated elements.

What you have in the example is a function $f: a \rightarrow b$ defined by $ f(x) = \begin{cases} 0.8 & \text{if } x = \text{true}\\ 0 & \text{if } x = \text{false}. \end{cases} $

You can replace the domain $a$ with any multiset of $0.8$'s and $0$'s. If you want to introduce new elements, you will need to specify how $f$ acts on them.

3

First observe that sets ignore repetitions. Namely, $\{x,x,y\}=\{x,y\}$.

Now you have some $f\colon a\to b$, and you want to say that $f(x)=0.8$, then you can write $f^{-1}(0.8)=x$, or if you prefer $x\in f^{-1}[0.8]$ to suggest that $f(x)=0.8$ but possibly other elements are mapped to $0.8$ as well.

In the same manner, $y\in f^{-1}[0]$ is to say that $f(y)=0$.

To put this into your particular example, $\text{true}=f^{-1}(0.8),\text{false}=f^{-1}(0)$.

  • 0
    @alan2here: I'm not sure what that means. However if you wish that all the elements which have the value $0.8$ in the first list will correspond to elements with value $\text{true}$ in the second list, then setting $f(0.8)=\text{true}$ is fine.2012-08-21