Bird
Raised Fist0
Signal Processingdata~20 mins

Error detection and correction basics in Signal Processing - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Error Detection and Correction Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Parity Bit Error Detection

Which statement correctly describes how a parity bit helps in error detection?

AIt encodes the data using multiple redundant bits to correct errors automatically.
BIt adds an extra bit to make the total number of 1s either even or odd, allowing detection of single-bit errors.
CIt compresses the data to reduce transmission errors by shortening the message length.
DIt encrypts the data to prevent unauthorized access during transmission.
Attempts:
2 left
💡 Hint

Think about how a single extra bit can signal if one bit changed during transmission.

❓ Predict Output
intermediate
2:00remaining
Output of Hamming Code Syndrome Calculation

What is the output of the following Python code that calculates the syndrome for a received 7-bit Hamming code?

Signal Processing
def calculate_syndrome(received):
    # Parity check matrix for (7,4) Hamming code
    H = [
        [1,0,1,0,1,0,1],
        [0,1,1,0,0,1,1],
        [0,0,0,1,1,1,1]
    ]
    syndrome = []
    for row in H:
        s = sum(r*b for r,b in zip(received, row)) % 2
        syndrome.append(s)
    return syndrome

print(calculate_syndrome([1,0,1,1,1,1,0]))
A[1, 0, 1]
B[0, 1, 1]
C[1, 1, 0]
D[0, 0, 0]
Attempts:
2 left
💡 Hint

Calculate each parity check bit by multiplying and summing modulo 2.

❓ data_output
advanced
2:00remaining
Number of Errors Detected by CRC

Given a 16-bit CRC code, how many bit errors can it reliably detect in a transmitted message?

AOnly single-bit errors, but not multiple-bit errors.
BOnly errors that affect the last 16 bits of the message.
CAll errors up to 16 bits in length, but not longer bursts.
DAll single-bit errors and all double-bit errors, plus any odd number of errors.
Attempts:
2 left
💡 Hint

Think about the properties of CRC codes and their error detection capabilities.

❓ visualization
advanced
2:00remaining
Visualizing Error Correction with Hamming Code

Which plot best shows the relationship between the number of bit errors and the ability of a (7,4) Hamming code to correct them?

AA step graph showing 0 errors corrected at 0 errors, 1 error corrected at 1 bit error, and failure beyond 1 error.
BA linear graph showing increasing corrected errors as bit errors increase.
CA bar chart showing equal correction for 0, 1, and 2 bit errors.
DA scatter plot with random points unrelated to error correction.
Attempts:
2 left
💡 Hint

Recall that Hamming code corrects single-bit errors but not multiple-bit errors.

🔧 Debug
expert
2:00remaining
Identify the Error in Parity Bit Calculation Code

What error does the following code produce when calculating even parity for a list of bits?

def even_parity(bits):
    parity = 0
    for bit in bits:
        parity ^= bit
    return parity == 1

print(even_parity([1, 0, 1, 0]))
AReturns True correctly for even parity calculation.
BRaises a TypeError because '^=' operator is invalid for integers.
CReturns False incorrectly because it checks parity == 1 instead of parity == 0 for even parity.
DSyntaxError due to missing colon in function definition.
Attempts:
2 left
💡 Hint

Check what the parity variable should equal for even parity.

Practice

(1/5)
1. What is the main purpose of error detection in data transmission?
easy
A. To find mistakes in data using extra bits
B. To increase the speed of data transmission
C. To compress data for storage
D. To encrypt data for security

Solution

  1. Step 1: Understand error detection

    Error detection uses extra bits added to data to check if errors occurred during transmission.
  2. Step 2: Identify the main goal

    The goal is to find mistakes, not to speed up, compress, or encrypt data.
  3. Final Answer:

    To find mistakes in data using extra bits -> Option A
  4. Quick Check:

    Error detection = find mistakes [OK]
Hint: Error detection finds mistakes, not speed or compression [OK]
Common Mistakes:
  • Confusing error detection with encryption
  • Thinking error detection speeds up data
  • Mixing error detection with data compression
2. Which of the following is the correct way to represent a parity bit for even parity in a 4-bit data 1011?
easy
A. Add a 1 to make total 1s count odd
B. Add a 0 to keep total 1s count even
C. Add a 1 to keep total 1s count even
D. Add a 0 to make total 1s count odd

Solution

  1. Step 1: Count 1s in data 1011

    Data bits: 1,0,1,1 have three 1s (odd count).
  2. Step 2: Determine parity bit for even parity

    To make total 1s even, add 0 (no change) would keep count odd, so add 1 to make count 4 (even).
  3. Final Answer:

    Add a 1 to keep total 1s count even -> Option C
  4. Quick Check:

    3 ones + 1 parity = 4 (even) [OK]
Hint: Count 1s, add parity bit to make total even [OK]
Common Mistakes:
  • Adding parity bit that keeps count odd
  • Confusing even and odd parity rules
  • Ignoring the current number of 1s
3. Given the 7-bit Hamming code 1001101, which bit position (1-indexed from left) contains the error if the parity bits check fails at positions 1 and 4?
medium
A. Position 3
B. Position 6
C. Position 7
D. Position 5

Solution

  1. Step 1: Understand parity check positions

    Parity bits in Hamming code are at positions 1, 2, 4. Errors detected at parity 1 and 4 mean bits 1 and 4 parity checks fail.
  2. Step 2: Calculate error position

    Add failing parity positions: 1 + 4 = 5. Error is at position 5.
  3. Final Answer:

    Position 5 -> Option D
  4. Quick Check:

    Sum parity errors = error position 5 [OK]
Hint: Sum failing parity bit positions to find error [OK]
Common Mistakes:
  • Ignoring parity bit positions
  • Adding wrong parity positions
  • Counting bits from right instead of left
4. Identify the error in this parity bit calculation code snippet for odd parity:
data = '1101'
parity = data.count('1') % 2
parity_bit = 1 if parity == 0 else 0
print(parity_bit)
medium
A. Counting 1s is incorrect; should count 0s
B. Parity bit assignment is correct; no error
C. Parity bit logic is reversed; should be 0 if parity is 0
D. Data string should be converted to integer list first

Solution

  1. Step 1: Understand odd parity logic

    Odd parity means total 1s including parity bit should be odd. Data '1101' has 3 ones (odd).
  2. Step 2: Check code logic

    parity=3%2=1 !=0, so parity_bit=0. Total 3 ones (odd). Logic sets 1 if even count (parity=0), else 0: correct for odd parity.
  3. Final Answer:

    Parity bit assignment is correct; no error -> Option B
  4. Quick Check:

    3 ones + 0 parity = 3 (odd) [OK]
Hint: Odd parity bit flips when count of 1s is even [OK]
Common Mistakes:
  • Reversing parity bit assignment
  • Counting zeros instead of ones
  • Assuming data type conversion needed
5. You receive a 7-bit Hamming code 0110011. Parity bits are at positions 1, 2, and 4. After checking parity bits, you find errors at positions 2 and 4. Which bit should you flip to correct the error?
hard
A. Bit at position 6
B. Bit at position 3
C. Bit at position 5
D. Bit at position 7

Solution

  1. Step 1: Identify parity bits with errors

    Errors at parity bits 2 and 4 mean these parity checks failed.
  2. Step 2: Sum parity error positions

    2 + 4 = 6, so the error is at bit position 6.
  3. Step 3: Correct the error by flipping bit 6

    Flipping bit 6 fixes the error detected by parity bits 2 and 4.
  4. Final Answer:

    Bit at position 6 -> Option A
  5. Quick Check:

    Sum parity errors = error bit 6 [OK]
Hint: Sum parity error positions to find bit to flip [OK]
Common Mistakes:
  • Ignoring parity bit positions
  • Adding wrong parity positions
  • Flipping wrong bit position
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard