Transmission media (wired, wireless) in Computer Networks - Time & Space Complexity
When studying transmission media, it is important to understand how the time to send data changes as the amount of data grows.
We want to know how the time needed to transmit data increases when we send more information over wired or wireless media.
Analyze the time complexity of the following data transmission process.
function transmitData(dataSize, mediaSpeed) {
for (let i = 0; i < dataSize; i++) {
sendBitOverMedia(i, mediaSpeed);
}
}
function sendBitOverMedia(bitIndex, speed) {
// Simulates sending one bit over the media at given speed
wait(1 / speed);
}
This code simulates sending each bit of data one by one over a transmission medium at a certain speed.
Identify the loops, recursion, array traversals that repeat.
- Primary operation: Sending each bit individually over the media.
- How many times: Exactly once per bit, so the number of times equals the data size.
As the data size increases, the total time to send all bits grows directly with it.
| Input Size (n) | Approx. Operations |
|---|---|
| 10 bits | 10 send operations |
| 100 bits | 100 send operations |
| 1000 bits | 1000 send operations |
Pattern observation: Doubling the data size doubles the number of send operations and thus the time.
Time Complexity: O(n)
This means the time to send data grows in direct proportion to the amount of data being sent.
[X] Wrong: "Sending data over wireless is always slower regardless of data size."
[OK] Correct: The time depends mainly on data size and media speed, not just the type. Wireless can be fast or slow depending on conditions.
Understanding how transmission time scales with data size helps you explain network performance clearly and confidently in real-world discussions.
"What if we could send multiple bits at once instead of one by one? How would the time complexity change?"
Practice
Solution
Step 1: Understand wired media
Wired media use physical cables to carry signals between devices.Step 2: Identify examples
Twisted pair cable is a common wired medium, while radio, infrared, and microwaves are wireless.Final Answer:
Twisted pair cable -> Option DQuick Check:
Wired media = cables like twisted pair [OK]
- Confusing wireless signals as wired
- Thinking infrared uses cables
- Mixing radio waves with cables
Solution
Step 1: Define wireless media
Wireless media transmit data through air without cables.Step 2: Identify correct examples
Radio waves and infrared are common wireless transmission methods.Final Answer:
Uses airwaves such as radio and infrared -> Option BQuick Check:
Wireless = airwaves like radio, infrared [OK]
- Choosing cable-based options
- Thinking wireless needs physical wires
- Assuming wireless only works indoors
media = ['Twisted Pair', 'Radio', 'Fiber Optic', 'Infrared'] wired = [m for m in media if 'Fiber' in m or 'Twisted' in m] print(wired)What will be the output?
Solution
Step 1: Understand list comprehension filter
The code selects items containing 'Fiber' or 'Twisted' from the media list.Step 2: Identify matching items
'Twisted Pair' and 'Fiber Optic' both match the condition, so they are included.Final Answer:
['Twisted Pair', 'Fiber Optic'] -> Option CQuick Check:
Filter for wired media = ['Twisted Pair', 'Fiber Optic'] [OK]
- Selecting wireless items by mistake
- Ignoring 'Fiber' keyword
- Confusing list output format
Solution
Step 1: Understand fiber optic transmission
Fiber optic cables transmit data using light signals inside glass fibers.Step 2: Compare with radio waves
Radio waves are wireless signals traveling through air, not inside cables.Final Answer:
Fiber optic cables use light, not radio waves -> Option AQuick Check:
Fiber optic = light signals, not radio waves [OK]
- Thinking fiber optic uses radio waves
- Confusing wireless and wired media
- Assuming fiber optic uses electricity only
Solution
Step 1: Analyze company needs
They want fast speeds and minimal interference in a large building.Step 2: Evaluate media options
Wireless radio waves can face interference and walls block signals; twisted pair is slower and less reliable over long distances; infrared requires line of sight; fiber optic offers high speed and low interference through cables.Final Answer:
Fiber optic cables for high speed and low interference -> Option AQuick Check:
Best for speed and interference = fiber optic cables [OK]
- Choosing wireless despite interference
- Ignoring speed differences
- Assuming infrared works through walls
Ready to prove it?
Pass the test and this pattern moves unknown
