Question: Is Hamming function one to one?

  • Thread starter Thread starter Topgun_68
  • Start date Start date
  • Tags Tags
    Function
Click For Summary

Homework Help Overview

The discussion revolves around the properties of the Hamming function, which measures the number of differing bits between two binary inputs. Participants are exploring whether this function is one-to-one based on its definition and examples.

Discussion Character

  • Conceptual clarification, Assumption checking

Approaches and Questions Raised

  • Participants discuss the implications of having multiple input combinations yielding the same output, questioning the one-to-one nature of the function. They consider the mapping of binary inputs to outputs and the limitations imposed by the number of bits.

Discussion Status

There is a general agreement among participants that the Hamming function is not one-to-one, supported by examples illustrating multiple inputs resulting in the same output. Some participants are reflecting on the implications of this conclusion and considering different contexts, such as encoding functions.

Contextual Notes

Participants note the constraints of the binary input space and the output range, specifically mentioning the number of possible inputs and outputs in the context of the function's mapping.

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:
Physics news on Phys.org
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
2K
  • · 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