Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You have two friends who want to find the average number of hours they sleep per night, over the course of a month ( 3
You have two friends who want to find the average number of hours they sleep per night, over the course of a month days
Alice uses the following algorithm: Each morning, she records the number of hours she slept the prior night. At the end of days, she adds up all of the numbers that she recorded, and then divides the result by
Bob uses the following algorithm: he starts with a total of Each morning, he adds the number of hours he slept the prior night to his current total, to get the new total. In other words, he keeps a running total of the number of hours of sleep so far in the month At the end of the days, he divides the running total by
Both of these algorithms will indeed give the average number of hours slept over the course of the month. Please explain why Alice might prefer her algorithm, and why Bob might prefer his. That is what are the benefits and drawbacks of these two algorithms?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started