---
title: "Cryptarithmetic RIGHT+RIGHT=WRONG"
subject: "Artificial Intelligence"
chapter: 2
key: "semester_6/artificial_intelligence:cryptarithmetic-right-right-wrong"
source: https://www.bctengineer.com/q/semester_6/artificial_intelligence/cryptarithmetic-right-right-wrong
site: BCT Engineering
---

# Cryptarithmetic RIGHT+RIGHT=WRONG

Artificial Intelligence · Chapter 2: Problem Solving

- Asked in: 2069 Poush, 7 marks
- Video: [Artificial Intelligence | Tutorial #2 | Crypt Arithmetic Problem](https://www.youtube.com/watch?v=2E-oGMJWUjQ) — RANJI RAJ
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/artificial_intelligence/cryptarithmetic-right-right-wrong
- Whole chapter: https://www.bctengineer.com/md/semester_6/artificial_intelligence/chapter-2

## Question

Solve the following crypto-arithmetic problem, where different letters denote different integers and identical letters denote the same integer: RIGHT + RIGHT = WRONG. Show all the steps of solving it through constraint satisfaction problem.

## Short answer

Using constraint satisfaction with column equations and carries, one solution is R=4, I=2, G=0, H=6, T=5, W=8, O=1, N=3 (42065+42065=84130).

## Answer

This is a **constraint satisfaction problem**.
- **Variables:** R, I, G, H, T, W, O, N
- **Domain:** {0, 1, ..., 9}
- **Constraints:** all letters different; R and W (leading letters) non-zero; the addition must be arithmetically correct.

```text
      R I G H T
    + R I G H T
    -----------
      W R O N G
```
The result has the same number of digits, so there is no carry out of the leftmost column.

#### Column equations (c1...c4 = carries, each 0 or 1)
1. T + T = G + 10·c1
2. H + H + c1 = N + 10·c2
3. G + G + c2 = O + 10·c3
4. I + I + c3 = R + 10·c4
5. R + R + c4 = W  (W ≤ 9)

#### Solving by constraint propagation and backtracking
- Column 1: G = 2T mod 10, so **G is even** and c1 = 1 if T ≥ 5.
- Column 5: W = 2R + c4 ≤ 9 ⇒ R ≤ 4, and W is even if c4 = 0.
- Choose **T = 5**: 5 + 5 = 10 ⇒ **G = 0, c1 = 1**.
- Column 2: H + H + 1 = N + 10·c2. Choose H = 6: 13 ⇒ **N = 3, c2 = 1**.
- Column 3: G + G + c2 = 0 + 0 + 1 = 1 ⇒ **O = 1, c3 = 0**.
- Column 4: I + I + 0 = R + 10·c4. Choose I = 2: 4 ⇒ **R = 4, c4 = 0**.
- Column 5: R + R + c4 = 8 ⇒ **W = 8**.
- Check distinctness: R = 4, I = 2, G = 0, H = 6, T = 5, W = 8, O = 1, N = 3, all different and R, W ≠ 0 ✓.

#### Verification
```text
      4 2 0 6 5
    + 4 2 0 6 5
    -----------
      8 4 1 3 0
```
42065 × 2 = 84130 = WRONG ✓

**Answer: R = 4, I = 2, G = 0, H = 6, T = 5, W = 8, O = 1, N = 3** (42065 + 42065 = 84130).

*Note:* the puzzle has several valid assignments (a computer search gives 11 in all, e.g. RIGHT = 47065, 10678, 15648, 31854). Any one that satisfies all constraints is correct.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Why is there no carry out of the leftmost column in RIGHT + RIGHT = WRONG?
   A. The carry is always 1
   B. R is zero
   C. The result has the same number of digits as the addends
   D. W is zero
   Answer: C. Both operands and the result have 5 digits, so no extra digit appears. (Key point: No leftmost carry)

2. What does column 1 (T + T = G + 10*c1) tell us about G?
   A. G is odd
   B. G equals T
   C. G is 5
   D. G is even
   Answer: D. G = 2T mod 10 is always even. (Key point: Column 1 rule)

3. From R + R + c4 = W with W <= 9, what follows?
   A. R <= 4
   B. R >= 5
   C. R = 0
   D. R is odd
   Answer: A. 2R + c4 <= 9 requires R <= 4. (Key point: Column 5 bound)

4. With T = 5, what are G and the carry c1?
   A. G = 5, c1 = 0
   B. G = 0, c1 = 1
   C. G = 0, c1 = 0
   D. G = 1, c1 = 1
   Answer: B. 5 + 5 = 10, so G = 0 and carry 1. (Key point: Chosen values)

5. What is the verified result?
   A. 42056 + 42056 = 84112
   B. 41065 + 41065 = 82130
   C. 42065 + 42065 = 84130
   D. 42065 + 42065 = 84310
   Answer: C. R=4, I=2, G=0, H=6, T=5, W=8, O=1, N=3 gives 84130. (Key point: Verification)

## Close variants set in other exams

- [Cryptarithmetic LOGIC+LOGIC=PROLOG](https://www.bctengineer.com/question.md?key=semester_6%2Fartificial_intelligence%3Acryptarithmetic-logic-prolog) — Artificial Intelligence, chapter 2, asked 3×

## Related in Artificial Intelligence

- [Cryptarithmetic WRONG+WRONG=RIGHT](https://www.bctengineer.com/question.md?key=semester_6%2Fartificial_intelligence%3Acryptarithmetic-wrong-wrong-right) — Artificial Intelligence, chapter 2
- [CSP and SWIM+WEAR=RELAX](https://www.bctengineer.com/question.md?key=semester_6%2Fartificial_intelligence%3Acsp-swim-wear-relax) — Artificial Intelligence, chapter 2
