Explore related knowledge and questions →

Question 4765: Simultaneous Variable Swap

On this page
  1. Original question and givens
  2. Definition and scope
  3. Step-by-step derivation
  4. Reverse checks
  5. Result
  6. This question review and source binding

Return to catalogue page 24

← Question derivation index · Original question batch

R0008-04765 · q-20261008-advance-20261011-r03-variable-expression-0040

Original question and givens

All operations and evaluations are exact in Q, not truncated natural-number arithmetic. E(x,y)=(15)x+(-14)y, x=2, y=17. Swap x and y simultaneously; give (original value, swapped value) as integers.

  • G001 — All operations and evaluations are exact in Q, not truncated natural-number arithmetic. E(x,y)=(15)x+(-14)y, x=2, y=17. Swap x and y simultaneously; give (original value, swapped value) as integers.

Definition and scope

Use the original question domain, assumptions and cited MKO definitions. This item has second-context mathematical and bilingual review, with the model, answer and every arithmetic step independently recomputed from the original parameters; the source question remains a candidate.

Step-by-step derivation

S001 · implies

Before

typed rational expression and explicitly given environment

After

evaluation,not solving an equation

Conditions: none

Evaluating an expression is not solving an equation;substitute only the supplied environment without inventing roots or changing bindings.

Step identifiers and dependencies

Rule: expression_environment_scope · Uses: G001

S002 · calculation

Before

original first term := mul(15, 2)

After

original first term = 30

Conditions: none

Multiply the first coefficient by the current environment's first component.

Step identifiers and dependencies

Rule: exact_rational_arithmetic · Uses: G001, S001

S003 · calculation

Before

original second term := mul(-14, 17)

After

original second term = -238

Conditions: none

Multiply the second coefficient by the second component of that same environment.

Step identifiers and dependencies

Rule: exact_rational_arithmetic · Uses: G001, S002

S004 · calculation

Before

original full value := sum(30, -238)

After

original full value = -208

Conditions: none

Add the two terms to evaluate this environment.

Step identifiers and dependencies

Rule: exact_rational_arithmetic · Uses: G001, S003

S005 · calculation

Before

simultaneously swapped first term := mul(15, 17)

After

simultaneously swapped first term = 255

Conditions: none

Multiply the first coefficient by the current environment's first component.

Step identifiers and dependencies

Rule: exact_rational_arithmetic · Uses: G001, S004

S006 · calculation

Before

simultaneously swapped second term := mul(-14, 2)

After

simultaneously swapped second term = -28

Conditions: none

Multiply the second coefficient by the second component of that same environment.

Step identifiers and dependencies

Rule: exact_rational_arithmetic · Uses: G001, S005

S007 · calculation

Before

simultaneously swapped full value := sum(255, -28)

After

simultaneously swapped full value = 227

Conditions: none

Add the two terms to evaluate this environment.

Step identifiers and dependencies

Rule: exact_rational_arithmetic · Uses: G001, S006

S008 · implies

Before

old environment=(x=2,y=17)

After

new environment=(x=17,y=2);old unchanged

Conditions: none

Both new components read the old environment;assigning x←y before letting y read the modified x would not be a genuine swap.

Step identifiers and dependencies

Rule: simultaneous_substitution_snapshot · Uses: G001, S007

Reverse checks

  • S008 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
  • S007 · premise_and_result_audit — Recompute simultaneously swapped full value with exact rational arithmetic, not rounded decimals.
  • S006 · premise_and_result_audit — Recompute simultaneously swapped second term with exact rational arithmetic, not rounded decimals.
  • S005 · premise_and_result_audit — Recompute simultaneously swapped first term with exact rational arithmetic, not rounded decimals.
  • S004 · premise_and_result_audit — Recompute original full value with exact rational arithmetic, not rounded decimals.
  • S003 · premise_and_result_audit — Recompute original second term with exact rational arithmetic, not rounded decimals.
  • S002 · premise_and_result_audit — Recompute original first term with exact rational arithmetic, not rounded decimals.
  • S001 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.

Result

(-208, 227)

The full substitutions and premise checks give the original answer; source identity,format and status are unchanged.

This question review and source binding

Review date: 2026-10-26

Original questions, answers, step expressions, numeric ASTs and historical records are retained. Source candidate labels remain historical and are not overwritten as formal proof.

Source hashes and review receipts
  • input commit: 0f7be61e2c22317a4075561dc822c87d881a50db
  • original question SHA-256: 39ee0fcbc71e5e2898fbb58b6ebd9ec74124c85cc8e430b968f207828946450f
  • candidate record SHA-256: 65f4b915994f03897909a423f67c4e9cd32a52f169bd8f9dcc8da7ba29e027b3
  • semantic review receipt SHA-256: b6e05a3e8193a93db505dbf337528fca72e2e41528b1e92b698a3f0683d74289
  • question-first witness SHA-256: caa8693baf0b91acd09a20215d1aa6954ae513fc0b0814f26ac1c8c834b60d67
  • Lean: NOT_RUN · human review: NOT_PERFORMED
Same-source full JSON