Question: Is Hamming function one to one?

  • Thread starter Thread starter Topgun_68
  • Start date Start date
  • Tags Tags
    Function
Topgun_68
Messages
34
Reaction score
0

Homework Statement



I have a Hamming function which takes two inputs, domain & co-domain and the output is how many bits are different.

Example: f(11100, 11101) = 1 (only one bit is different).

Is this one to one?

I say no because there could be many other combinations if inputs that can produce the same answer as the output. For example f(11110, 11100) = 1 also.

I just want to know if my thinking is correct or totally off base.

Thanks for any feedback!
 
Last edited:
I think you're right. If you were to plot the function using all binary numbers from 00000 to 11111 there are 32 choices but only 5 bits so the reverse mapping would have several y values for any given x value on the 0 to 5 domain.
 
I didn't even think to check it out that way. So with 32 inputs (domain) and 5 outputs (range), there's no way it can be one to one unless I'm missing something.

Now if it we're an encoding function where it would have to encode/decode back and forth, that would be one to one I think.

Thanks for the input.

jedishrfu said:
I think you're right. If you were to plot the function using all binary numbers from 00000 to 11111 there are 32 choices but only 5 bits so the reverse mapping would have several y values for any given x value on the 0 to 5 domain.
 
Topgun_68 said:

Homework Statement



I have a Hamming function which takes two inputs, domain & co-domain and the output is how many bits are different.

Example: f(11100, 11101) = 1 (only one bit is different).

Is this one to one?

I say no because there could be many other combinations if inputs that can produce the same answer as the output. For example f(11110, 11100) = 1 also.

I just want to know if my thinking is correct or totally off base.

Thanks for any feedback!

Your example shows that f is not 1:1; end of story.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 32 ·
2
Replies
32
Views
4K
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K