Learning preferences

Make learning more comfortable. Changes apply immediately.

Enlarges page content, including diagrams and their labels. You can also use your browser’s zoom.

Choose the colours that are easiest for you to distinguish. Applies to lesson diagrams and lab plots. Labels, shapes, hatching and line patterns also distinguish meanings. Source photographs and raw image brightness stay unchanged; mask-only views are available for image overlays.

ExampleComparisonSample link

Saved in this browser on this device. Preferences are separate from progress backups.

Lesson 3 of 4

Turn a modular obstruction into a reachability theorem

Discover an invariant on an integer grid, then solve for move counts to distinguish reversible and forward-only reachability.

Loading your saved responses…

Try the optional starting-point checks and targeted refreshers. You can continue directly into this lesson.

Try

A robot stands at an integer grid point. One command moves it two units right and one up; another moves it one right and two up. Write these displacement vectors as u=(2,1) and v=(1,2). For now the grid has no walls, obstacles or forbidden intermediate coordinates.

Starting at the origin, can it reach (1,1)? Both commands increase the sum of the coordinates by 3, while the requested point has sum 2. No amount of trying different command orders can repair that mismatch. This is an obstruction proved for every finite route, not merely a failure to find a route in a limited search.

Now ask about (0,3). Its coordinate sum passes the same check. Does that guarantee a route? Keep your answer tentative until the rules specify whether reverse commands are available.

Predict

Compare two models. In the forward-only model, commands are u and v. In the reversible model, commands also include −u and −v. Predict which model reaches (0,3), and whether reversing a command changes the remainder of the coordinate sum modulo 3.

An invariant is a property preserved by every allowed move. Here it is the remainder of x+y, not the value of x+y itself. A reverse command changes the sum by −3 and therefore preserves the same remainder. From an arbitrary starting point S, compare the target sum with the sum at S; testing every target against remainder zero would incorrectly assume that every route starts at the origin.

Experiment

Build this route with arrows on squared paper. Each row is a state, not just a final answer. Label the reverse command explicitly.

Command just takenStateCoordinate sumRemainder modulo 3
Start(0,0)00
v(1,2)30
v(2,4)60
−u(0,3)30

Thus the reversible model succeeds. The forward-only model cannot take the last command. Prove impossibility there without assuming that this particular route was the only candidate: any nonempty forward route increases the first coordinate, whereas the target first coordinate is zero.

Change the target to (5,4). Three forward commands work: u,u,v. Reverse their order and inspect which intermediate states change. Vector addition explains the shared endpoint; it does not say that the intermediate route is identical.

Understand

Let (x,y) now denote displacement from the chosen start, not necessarily the absolute target coordinates. If m and n are the net counts of u and v, the endpoint equations are 2m+n=x and m+2n=y. Solving by subtraction gives

m=(2x−y)/3, n=(2y−x)/3.

In the reversible model these counts may be negative. If x+y is divisible by 3, then 2x−y=3x−(x+y) and 2y−x=3y−(x+y) are divisible by 3 too. Both counts are integers. Take m forward u commands when m is positive, or −m reverse u commands when it is negative; do the analogous construction for n. This is a finite legal route because all integer intermediate states are permitted. Together with the invariant argument, it proves both necessity and sufficiency: reversible reachability is equivalent to the displacement sum being divisible by 3.

In the forward-only model, actual command counts must be nonnegative. The complete criterion is therefore the same divisibility condition together with 2x−y≥0 and 2y−x≥0. Necessity follows from the equations for any route; sufficiency follows by executing the resulting nonnegative counts. This is a constructive theorem, stronger than checking a preserved remainder.

For displacement (0,3), the equations give m=−1,n=2, explaining precisely why reverses help. For (5,4), they give m=2,n=1. Net coefficients are uniquely determined because these two linear equations have a unique solution. The order of commands need not be unique, and a reversible route can add cancelling command pairs without changing its net coefficients.

Do not transfer this sufficiency proof to a board with walls without checking it. For example, restrict states to the square with coordinates between 0 and 2. From (0,2), every one of the four possible first commands exits that square. The target (2,0) has the same sum and an unrestricted route, yet is unreachable on this board. The modular obstruction remains necessary; the construction of intermediate states has failed.

Apply

Start at (2,−1) and target (6,4). First compute displacement (4,5); do not apply the formulas to (6,4). Its coefficients are m=1,n=2, so a forward route exists and has three commands. Check one ordered route and then justify why every forward route has that same number of commands.

Next replace the generators by (3,1) and (1,3). The sum remainder modulo 4 is preserved, but (2,2) is not reachable even with reverse moves: solving the equations requires half a command of each kind. Derive the actual integer-coefficient criterion in practice. The lesson is not that invariants are unreliable; it is that a necessary invariant must be paired with a separate sufficiency proof before being called a complete classification.

Continue

For each new reachability problem, write the allowed state set and both the permitted and forbidden directions before searching. Then separate three obligations: prove an obstruction, solve for candidate move counts, and verify a legal route under the actual intermediate-state restrictions. Finite experiments can suggest the invariant and expose counterexamples. The general proof explains why the conclusion holds beyond every tested route.

Apply · explain · revise

Practice and reasoning

Drafts save locally as you type. Reveal worked solutions when useful; the site remembers that exposure. Automatic matches check the requested answer, while written arguments require review against the rubric.

Start at (4,−2). Decide whether (10,5) and (11,6) are reachable with reverse moves. For every reachable target give move counts; for every rejected target give an invariant proof. Explain why testing the target coordinate sum against zero is the wrong off-origin test.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

For displacement (x,y), prove that reverse-enabled reachability is equivalent to x+y divisible by3. Derive coefficients m,n for m(2,1)+n(1,2)=(x,y), explain their integrality and construct a finite route for negative coefficients.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Prove a necessary and sufficient forward-only criterion for displacement (x,y). Apply it to (6,3), (0,3) and (−3,−3). All three sums are divisible by3; explain their different outcomes.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

From (−1,4), reach (8,10) using forward moves. Prove the move counts and total length are forced, but the ordered route need not be unique. In the reverse-enabled model determine the minimum length and explain why longer routes exist.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Replace the moves by p=(3,1),q=(1,3), with both reverses allowed. Prove a complete reachability criterion for displacement (x,y). Show that x+y divisible by4 is necessary but insufficient, using (2,2). Give a reachable changed case.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Keep reverse moves ±u,±v, but permit only states in the square 0≤x≤2,0≤y≤2. Starting at (0,1), test target (1,0). Compare the unrestricted coefficient construction with actual first moves in the square. Then find a pair of congruent states in this square that are not connected and prove impossibility. What hypothesis of the general theorem changed?

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Reflect and continue

Before marking this lesson complete, explain one key idea without the worked solution and identify a condition that matters. Marking complete records participation, not independent mastery.