So here is the code in Python:
n = 0.00 #this is a float because there are some numbers that are decimals.
while n < 20: #n which is 0.00 and while it is lower than 20 if runs the code below
n = n + 1 #it will add 1 to n everything it runs the code.
k = n / 2 #it will divide whatever n is everytime by 2
print(str(n) + '/2: ') # it's printing the number it's on
print(k) # prints the answer for the n.
You can change n to add by any, make n any num instead of 0.00 and you can change the while condition from n < 20 to any other logical statement. If you want to get creative you can take 2 inputs for numbers and make one of them the starting number and other one is the ending number. Also make sure to make n a number lower than you starting point because if you set n as your starting point then it will skip it.
Answer
First part:
The transmitted 8-bit sequence for ASCII character '&' with odd parity will be 00100110. Here leftmost bit is odd parity bit.
Second part:
The invalid bit sequence are option a. 01001000 and d. 11100111
Explanation:
Explanation for first part:
In odd parity, check bit of either 0 or 1 is added to the binary number as leftmost bit for making the number of 1s in binary number odd.
If there are even number of 1s present in the original number then 1 is added as leftmost bit to make total number of 1s odd.
If there are odd number of 1s present in the original number then 0 is added as leftmost bit to keep the total number of 1s odd.
Explanation for second part:
A valid odd parity bit sequence will always have odd number of 1s.
Since in option a and d, total number of 1s are 2 and 6 i.e. even number. Therefore they are invalid odd parity check bit sequences.
And since in option b and c, total number of 1s are 5 and 7 i.e. odd numbers respectively. Therefore they are valid odd parity check bit sequences.
Each person has a electronic chip-enabled ID card, which lets them vote on the internet. The ID card is put into the card reader that is connected the computer. :)