Corresponding Binary Strings of Odd and Even 1's?

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
 
There are two things I don't understand about this problem. First, when finding the nth root of a number, there should in theory be n solutions. However, the formula produces n+1 roots. Here is how. The first root is simply ##\left(r\right)^{\left(\frac{1}{n}\right)}##. Then you multiply this first root by n additional expressions given by the formula, as you go through k=0,1,...n-1. So you end up with n+1 roots, which cannot be correct. Let me illustrate what I mean. For this...
Back
Top