Discrete Math Question. I'm not sure how to start solving this. Suggestions?
Determine if f is a function from the set of all bit strings to the set of integers: f(S) is the position of a 1 bit in the bit string S. Explain, with an example or two, why or why not.
- SamwiseLv 79 months ago
As defined, f(S) is a function from the set of all bit strings which have only a single 1 bit to the set of all integers. For instance,
f(1) = 1
f(000100) = 4
[assuming we define the "position" of a bit by numbering the bits left to right, starting with 1].
But it's not a function from the set of ALL bit strings, because in that case, there are strings for which f(S) can return multiple values. For instance,
f(101) = 1
f(101) = 3