107k views
2 votes
PLEASE HELP ME!

Question 1. Mr. Beaver has four friends. They live in different houses. Each day he sets off from
home to visit one friend. When Mr. Beaver reaches a fork in the road he follows the arrow but, as
he passes, turns the arrow so that it now faces in the opposite direction. He always ignores the
arrows when retuming home.
On the first day he visits friend W. On day 2 he visits friend Y because he switched two arrows
around the day before. Etc.


2a) Which friend does Mr. Beaver visit on day 206? Explain your answer.
to come up with your answer

2b) Which aspect(s) of computational thinking were used

PLEASE HELP ME! Question 1. Mr. Beaver has four friends. They live in different houses-example-1

1 Answer

5 votes

Answer:

2a) friend Y

2b) modulo calculations, state machines

Step-by-step explanation:

After 4 days, history repeats itself. If you work out the first few days of the visiting pattern, you find that day 5 is identical to day 1.

So, if you divide the day number by 4 and take the remainder (i.e., the modulus), you get the original day number (where day 0 == day 4).

206 modulo 4 is 2, i.e., the second day where friend Y is visited.

The system behaves like a state machine with only 4 states.

User Unrahul
by
5.7k points