Corresponding Binary Strings of Odd and Even 1's?

Click For Summary
SUMMARY

This discussion addresses the problem of establishing a one-to-one correspondence between binary strings of length k with odd and even counts of 1's. It is established that for any binary string of length k, there are 2^(k-1) strings with odd 1's and 2^(k-1) strings with even 1's. The solution involves creating a new binary string by inverting the bits of the original string, which guarantees that a string with an odd number of 1's corresponds to a string with an even number of 1's, thus confirming the one-to-one mapping.

PREREQUISITES
  • Understanding of binary strings and their properties
  • Basic knowledge of combinatorics, specifically counting principles
  • Familiarity with the concept of one-to-one mappings
  • Knowledge of bit manipulation techniques
NEXT STEPS
  • Study the properties of binary strings and their combinations
  • Learn about combinatorial proofs and their applications
  • Explore bit manipulation techniques in programming
  • Investigate more complex mappings in discrete mathematics
USEFUL FOR

Students in computer science, mathematicians interested in combinatorics, and anyone studying binary data representation and manipulation.

future_phd
Messages
19
Reaction score
0

Homework Statement


Find a one-to-one correspondence between the binary strings (i.e. sequences of 0's and 1's) of length k that have an odd number of 1's, and those that have an even number of 1's.


Homework Equations





The Attempt at a Solution


I'm not exactly sure of what it's asking me to do.
If it's of length k, then you have 2^k different combinations. Half of these will have an even number of 1's, half will have an odd number. So you get (2^k)/2 or 2^(k-1) with an odd number of 1's, and 2^(k-1) with an even number of 1's. Not exactly sure where to go from here.
 
Last edited:
Physics news on Phys.org
If I understand this problem correctly, it's very easy. There's no guarantee that I understand it correctly, though.:biggrin:

Consider a binary string of length k, with n 1's and (k - n) 0's. Form a new string of the same length, switching 1's to 0's and 0's to 1's. The new string will have n 0's and (k - n) 1's.

This is clearly a 1:1 mapping, and I think you can satisfy yourself that if the first string had an odd number of 1's, the new string will have an even number of 1's.
 
Mark44 said:
If I understand this problem correctly, it's very easy. There's no guarantee that I understand it correctly, though.:biggrin:

Consider a binary string of length k, with n 1's and (k - n) 0's. Form a new string of the same length, switching 1's to 0's and 0's to 1's. The new string will have n 0's and (k - n) 1's.

This is clearly a 1:1 mapping, and I think you can satisfy yourself that if the first string had an odd number of 1's, the new string will have an even number of 1's.
Ahh! That makes sense, that's probably what it's asking. Thanks! :D
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
5
Views
3K
  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 17 ·
Replies
17
Views
3K
  • · Replies 16 ·
Replies
16
Views
5K
  • · Replies 5 ·
Replies
5
Views
2K