I can answer problem 2!
This problem can be solved by analyzing the behavior of the function f(x, y) at different points and identifying repeating patterns.
Understanding the Function:
The function f(x, y) modifies the x and y coordinates based on the initial values of x and y.
If x > 4, it subtracts 4 from x and keeps y the same. (e.g., f(5, 1) = (1, 1))
If x <= 4 and y > 4, it keeps x the same and subtracts 4 from y. (e.g., f(2, 5) = (2, 1))
Otherwise (x <= 4 and y <= 4), it adds 5 to x and adds 2 to y. (e.g., f(1, 1) = (6, 3))
Analyzing the Robot's Movement:
Starting Point: The robot starts at (1, 1).
First Iteration: Applying f(1, 1) based on the third rule (x <= 4 and y <= 4), we get f(1, 1) = (6, 3).
Subsequent Iterations:
At (6, 3), x > 4 and y > 4. So, f(6, 3) = (2, -1). (This is because x is now greater than 4, and y is greater than 4 in the new position).
At (2, -1), x <= 4 and y <= 4. So, f(2, -1) = (7, 1).
At (7, 1), x > 4 and y <= 4. So, f(7, 1) = (3, 1).
Repeating Pattern:
Notice how the robot's movement falls into a repeating cycle: (1, 1) -> (6, 3) -> (2, -1) -> (7, 1) -> (3, 1) -> (8, 3) -> ...
This cycle repeats because after reaching (3, 1), the function follows the same path back to (1, 1) and continues the cycle infinitely.
Number of Unique Points:
Within this cycle, there are 4 unique points visited: (1, 1), (6, 3), (2, -1), and (7, 1).
Therefore, the robot will visit only 4 unique points regardless of how long it runs.