Binary strings and Onto functions

386 Views Asked by At

Let $B_3$ be the set of all binary strings of length $3$ and let $B_4$ be the set of all binary strings of length $4.$ There is at least one function $f : B_4 \to B_3$ that is onto. Is this true or not? Provide a proof either way.

1

There are 1 best solutions below

5
On BEST ANSWER

A function without any structure is easy to find:

All the ones in $B_4$ with the leftmost bit being $0$ are mapped to their respective pair

$$ 0010\mapsto 010 $$

and the ones having a $1$ in the leftmost bit are mapped to $0$.

For structure preserving maps convert the strings into numbers in base $10$ to make it easier and modding by $8$ would make a map

$$ f:B_4\to B_3\qquad f(x)=[x]_8 $$ $[x]_8$ meaning the equivalence class modulo $8$.

Hope this helped