Question

In: Computer Science

A string of 0s and 1s is to be processed and converted to an even-parity string...

A string of 0s and 1s is to be processed and converted to an even-parity string by adding a parity bit to the
end of the string.(For an explanation of the use of parity bits, see Example 30 in Chapter 9.) The parity
bit is initially 0. When a 0 character is processed, the parity bit remains unchanged. When a 1 character
is processed, the parity bit is switched from 0 to 1 or from 1 to 0. Prove that the number of 1s in the final
string, that is, including the parity bit, is always even. (Hint: Consider various cases.)

Solutions

Expert Solution

The information used to prove the given statement is as follows:

  • Whenever a zero is added to the string the parity bit remains unchanged.
  • Whenever a one is added to the string the parity bit is switched, that is, if the parity bit is 1 then it is switched to 0 and vice-versa.

Proof:

When the first 1 is added to the string the parity bit is switched to 1, when the second 1 is added to the string it is again switched back to zero, for the third one it is again switched to 1 and so on.

Therefore, whenever there are (2n + 1) ones in the string then the parity bit is 1 and for 2n ones in the string the parity bit is 0, where (n>=0; n is an integer).

Case 1: When there are (2n+1) ones in the string:

Since, the parity bit is 1 in this case the total number of ones in the final string is equal to the number of ones in the original string plus 1.

Total number of ones in the final string = (2n + 1) + 1

= (2n + 2)

= 2(n+1)

A number multiplied by 2 is always an even number, therefore the total number of 1’s in this case will always be even.

Case 2: When there are (2n) ones in the string:

Since, the parity bit is zero in this case the total number of ones in the final string is equal to the number of ones in the original string only.

Total number of ones in the final string = 2n

A number multiplied by 2 is always an even number, therefore the total number of 1’s in this case will always be even.

Since, for all the cases, the total number of ones are always even in the final string (including the parity bit.) , therefore, the given statement is true.

Hence, proved.


Related Solutions

P [1r / 0s] = 0.03 and P [0r / 1s] = 0.02 conditional in an...
P [1r / 0s] = 0.03 and P [0r / 1s] = 0.02 conditional in an asymmetric binary communication channel available. The probability of sending 0 in this channel is P [1s] = 0.56. 25 bits from this channel It has been sent. Accordingly, find the possibility of fewer than 3 faulty bits in the 25 bits transmitted. Note: 0s : 0 transmit, 1s : 1 transmit, 0r : 0 represent, 1r : 1 represent running events.
The transmitter transmits either an infinite sequence of 0s with a probability 2/3 or 1s with...
The transmitter transmits either an infinite sequence of 0s with a probability 2/3 or 1s with a probability 1/3. Each symbol, regardless of the others and the transmitted sequence is identified by the receiving device with an error with a probability 0.25. i) Given that the first 5 identified symbols are 0s, find the probability P (000000 | 00000) that the sixth received symbol is also zero. b) Find the average value of a random variable equal to the number...
Advance programing in java Qn1 1.True or False: (a) A sequence of 0s and 1s is...
Advance programing in java Qn1 1.True or False: (a) A sequence of 0s and 1s is called a decimal code. (b) ZB stands for zero byte. (c) The CPU stands for command performing unit. (d) Every Java application program has a method called main. (e) An identier can be any sequence of digits and letters. (f) Every line in a program must end with a semicolon. 2. Explain the two most important benets of the Java language 3 Explain the...
(C++) Write a program that randomly fills in 0s and 1s into a 5-by-5 matrix,prints the...
(C++) Write a program that randomly fills in 0s and 1s into a 5-by-5 matrix,prints the matrix,and finds which row and column with more 1s and display that row and column number.            
A population contains nine million 0s and seven million 1s. What is the sampling distribution of...
A population contains nine million 0s and seven million 1s. What is the sampling distribution of the sample mean when the sample size is n=5? Let X be the number of 1s. Complete the chart below. X ​P(X) x 0 nothing nothing 1 nothing nothing 2 nothing nothing 3 nothing nothing 4 nothing nothing 5 nothing nothing ​(Round to three decimal places as​ needed.)
The Double.parseDouble() method requires a String argument, but it fails if the String cannot be converted...
The Double.parseDouble() method requires a String argument, but it fails if the String cannot be converted to a floating-point number. Write an application in which you try accepting a double input from a user and catch a NumberFormatException if one is thrown. The catch block forces the number to 0 and displays Value entered cannot be converted to a floating-point number. Following the catch block, display the number. import java.util.*; public class TryToParseDouble {     public static void main(String[] args)...
Construct an even parity Hamming code for 1101010
Construct an even parity Hamming code for 1101010
48 sample - 9 "0s" = 39 39 "1s" / 48 total sample= 0.8125 pq=0.9*(1-0.9) 0.09...
48 sample - 9 "0s" = 39 39 "1s" / 48 total sample= 0.8125 pq=0.9*(1-0.9) 0.09 pq/n= 0.09/48 0.001875 sqrt (pq/n)= sqrt (0.001875) 0.043301 sample prop / 90% =0.8125-0.9 -0.0875 z=-0.0875/0.043301 -2.02073 p value =NORMSDIST(H7) 0.02165 An air quality instrument logs 0 when standards are not met and 1 when standards are met. The log is saved to file DATA. First, compute the proportion meeting standards as the mean of air quality values. Second, at alpha=0.10 (sensitive, exploratory), test the...
48 sample - 9 "0s" = 39 39 "1s" / 48 total sample= 0.8125 pq=0.9*(1-0.9) 0.09...
48 sample - 9 "0s" = 39 39 "1s" / 48 total sample= 0.8125 pq=0.9*(1-0.9) 0.09 pq/n= 0.09/48 0.001875 sqrt (pq/n)= sqrt (0.001875) 0.043301 sample prop / 90% =0.8125-0.9 -0.0875 z=-0.0875/0.043301 -2.02073 p value =NORMSDIST(H7) 0.02165 An air quality instrument logs 0 when standards are not met and 1 when standards are met. The log is saved to file DATA. First, compute the proportion meeting standards as the mean of air quality values. Second, at alpha=0.10 (sensitive, exploratory), test the...
- Give state diagram of DFA recognizing L={w | w is 0,1-string, and contains 3k 0s...
- Give state diagram of DFA recognizing L={w | w is 0,1-string, and contains 3k 0s and 2m 1s for some integers k and m at least 0}. For examples, 0010111 is in L, but 010011 is not in L. The first string contains 3 0s and 4=2x2 1s, but the second string has an odd number of 1s.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT