Hey, so I have this problem and I need some kind of help:
For each sentence, write a corresponding equation using modular arithmetic. Example: "If Monday is the first day of the week and Sunday is the seventh day of the week, then four days past Saturday (the sixth day) is Wednesday (the third day)" corresponds to the equation
(6 + 4) mod 7 = 3
Also, this problem:
An algorithm.
input b
p â†0
while b > 0:
p â†p + 3
b â†b - 1
output p
Thanks,
Crazysah
For each sentence, write a corresponding equation using modular arithmetic. Example: "If Monday is the first day of the week and Sunday is the seventh day of the week, then four days past Saturday (the sixth day) is Wednesday (the third day)" corresponds to the equation
(6 + 4) mod 7 = 3
"Eighteen-hundred hours in military time is what we might call six p.m."
"In a shift cipher with key 7, plaintext letter w becomes ciphertext letter D."
Also, this problem:
An algorithm.
input b
p â†0
while b > 0:
p â†p + 3
b â†b - 1
output p
- What does this algorithm output when given, respectively, input values of 2, 3, and 5?
- In a clear and concise sentence explain what this algorithm computes.
- Is this an efficient algorithm? Can you think of a more efficient way to achieve the same result? Explain.
Thanks,
Crazysah