25.4k views
2 votes
You track your commute times for three weeks (15 days), recording the following times in minutes: 17, 16, 20, 24, 22, 15, 21, 25, 17, 90, 16, 17, 22, 20, 20. Enter the data into a 3-by-5 matrix, where rows are weeks and columns are weekdays. Please answer the following questions and provide the necessary code. (a) Name each column with the weekday abbreviations, i.e., Mon, Tue, Wed, Thu, and Fri (b) Find the shortest, the longest, the average, and the median commute time within those three weeks. (c) The 90 was a mistake. It should have been 19. How can you fix this? Do so, and then find the new average and median. (d) How many times was your commute 20 minutes or more? (e) What percent of your commutes are less than 18 minutes long? (f) In average, which weekday you spend the most commute time?

User Enthouan
by
5.3k points

1 Answer

1 vote

Answer:

b) 15,90,24.133,20

c) New average = 19.4, New Median = 20

d) 8

e) 40%

f) Wednesday

Explanation:

a) Mon Tue Wed Thu Fri

Week 1 17 16 20 24 22

Week 2 15 21 25 17 90

Week 3 16 17 22 20 20

This is a 3×5 matrix where the rows gives us the weeks(Week 1, Week 2, Week 3) and the columns are the weekdays(Mon, Tue, Wed, Thu, Fri).

b)The shortest duration out of the data given for fifteen days is 15 minutes.

The longest duration is 90 minutes.

To calculate the average of given data, we use the following formula:

Average =
\frac{\text{Sum of all observations}}{\text{Total no of observations}}

=
(17+16+20+24+22+15+21+25+17+90+16+17+22+20+20)/(15)

=
(362)/(15)

=24.133

Median = the value that divides the data into two equal parts]

Ascending order: 15,16,16,17,17,17,20,20,20,21,22,22,24,25,90

Median =
((n+1)/(2))\text{th term} = 8th term = 20

c) Mon Tue Wed Thu Fri

Week 1 17 16 20 24 22

Week 2 15 21 25 17 19

Week 3 16 17 22 20 20

New average =
\frac{\text{Sum of new observations}}{\text{Total no of observations}}

=
(17+16+20+24+22+15+21+25+17+19+16+17+22+20+20)/(15)

=
(362)/(15)

=19.4

New Median

Ascending order: 15,16,16,17,17,17,19,20,20,20,21,22,22,24,25

Median =
((n+1)/(2))\text{th term} = 8th term = 20

d) In order to know how many times we commute for 20 minutes or more, we check the entries that are greater than or equal to 20 minutes. We have 8 such entries. Thus, 8 times the commute was 20 minutes or more longer.

e) Percent of commutes less than 18 minutes =
\frac{\text{Commutes that are less than 18 minutes}}{\text{Total number of commutes} }× 100%

=
(6)/(15)×100% = 40%

f) Average =
\frac{\text{Sum of all observations}}{\text{Total no of observations}}

Average time spent in commuting on Monday = 16

Average time spent in commuting on Tuesday = 18

Average time spent in commuting on Wednesday = 22.3

Average time spent in commuting on Thursday = 20.3

Average time spent in commuting on Friday= 20.3

On Wednesday, we spent the most on commute time.

User Theophilus
by
5.1k points