Study guide
5.2 Coding, Decoding & Rule-Based Substitution
Ghana Armed Forces Recruit Aptitude Test GAF-RAT
Track your progress as you read
Finished sections get a check mark.
1 Chapter 1: GAF Recruitment Architecture & Exam Strategy
1.1 GAF Recruitment Process, Eligibility & Selection Phases 1.2 What the Aptitude Test Measures & How to Prepare
2 Chapter 2: English Language & Verbal Reasoning
2.1 Spelling Conventions & High-Frequency Confusables 2.2 English Grammar, Syntax & Sentence Correction 2.3 Vocabulary, Synonyms & Antonyms in Context 2.4 Reading Comprehension & Factual Inference
3 Chapter 3: Numerical Operations & Everyday Arithmetic
3.1 Mental Arithmetic, Order of Operations, Integers & Number Properties 3.2 Fractions, Decimals & Percentages 3.3 Ratios, Proportions & Practical Rates
4 Chapter 4: Applied Quantitative Problem Solving
4.1 Elementary Algebra & Linear Equations 4.2 Plane Geometry, Perimeter, Area & Mensuration 4.3 Everyday Word Problems: Money, Time, Ages, Averages & Units
5 Chapter 5: Logical & Abstract Reasoning
5.1 Number Sequences & Alphanumeric Patterns 5.2 Coding, Decoding & Rule-Based Substitution 5.3 Abstract Spatial Reasoning & Non-Verbal Matrices 5.4 Formal Deductions, Syllogisms & Venn Logic
6 Chapter 6: Ghanaian Geography, History & Governance
6.1 Geography, Natural Resources & Administrative Regions of Ghana 6.2 Modern History, Independence Milestones & National Symbols 6.3 Constitution, Civic Institutions & Arms of Government
7 Chapter 7: Ghana Armed Forces Structure, Ranks, Defence & Current Affairs
7.1 GAF Command Structure, Service Branches & International Missions 7.2 Military Rank Structure: Army, Navy and Air Force 7.3 Current Affairs & National Leadership Checkpoints (2025–2026)
5.2 Coding, Decoding & Rule-Based Substitution
Key Takeaways Explain This Topic AI
Coding and decoding questions assess a recruit's capacity to identify and apply systematic character substitutions, positional transpositions, and rule-based translations.
Letter-shift ciphers apply either uniform displacements (Caesar shifts of + k +k + k or − k -k − k ) or progressive variable shifts ( + 1 , + 2 , + 3 , … +1, +2, +3, \dots + 1 , + 2 , + 3 , … ) requiring rapid conversion between letters and alphabetic numbers.
Opposite-letter substitution pairs letters from opposing ends of the alphabet whose numeric indices sum to 27 ( A ↔ Z A \leftrightarrow Z A ↔ Z , B ↔ Y B \leftrightarrow Y B ↔ Y , M ↔ N M \leftrightarrow N M ↔ N ), forming symmetric cryptographic pairs.
Artificial language puzzles are solved through comparative sentence cross-referencing, isolating distinct vocabulary definitions by identifying shared code tokens across translated statements.
Last updated: October 2026
5.2 Coding, Decoding & Rule-Based Substitution
In military communication, security protocols demand that sensitive operational data—including patrol routes, operational codewords, tactical coordinates, and equipment status—be transmitted using structured encryption systems. Coding and decoding items, a common feature of logical reasoning tests, evaluate an applicant's ability to decipher rule-based symbol substitutions, detect geometric and positional transpositions, and decode artificial languages under timed pressure. These questions do not require prior knowledge of formal intelligence ciphers; rather, they test acute attention to detail, systematic deduction, and the disciplined execution of transformation algorithms without introducing personal assumptions.
Letter-Shift Ciphers (Uniform and Progressive Systems)
Letter-shift ciphers, historically derived from the classical Caesar cipher, substitute each letter of an original plaintext message with another letter located a fixed or progressive number of positions away in the English alphabet.
1. Fixed Uniform Shifts
In a uniform shift cipher, every letter undergoes an identical displacement ( + k +k + k or − k -k − k positions). When a shift advances past the end of the alphabet ( Z Z Z ), it wraps cyclically back to the beginning ( A A A ): Shifted Position = [ ( Initial Position − 1 + k ) ( m o d 26 ) ] + 1 \text{Shifted Position} = [(\text{Initial Position} - 1 + k) \pmod{26}] + 1 Shifted Position = [( Initial Position − 1 + k ) ( mod 26 )] + 1
Consider an operational example where the plaintext word MARCH is encrypted as PDUFK :
- M ( 13 ) + 3 = 16 ⟹ P M(13) + 3 = 16 \implies P M ( 13 ) + 3 = 16 ⟹ P
- A ( 1 ) + 3 = 4 ⟹ D A(1) + 3 = 4 \implies D A ( 1 ) + 3 = 4 ⟹ D
- R ( 18 ) + 3 = 21 ⟹ U R(18) + 3 = 21 \implies U R ( 18 ) + 3 = 21 ⟹ U
- C ( 3 ) + 3 = 6 ⟹ F C(3) + 3 = 6 \implies F C ( 3 ) + 3 = 6 ⟹ F
- H ( 8 ) + 3 = 11 ⟹ K H(8) + 3 = 11 \implies K H ( 8 ) + 3 = 11 ⟹ K
Every character undergoes a uniform shift of + 3 +3 + 3 . To encode the word TRACK using this same cipher:
- T ( 20 ) + 3 = 23 ⟹ W T(20) + 3 = 23 \implies W T ( 20 ) + 3 = 23 ⟹ W
- R ( 18 ) + 3 = 21 ⟹ U R(18) + 3 = 21 \implies U R ( 18 ) + 3 = 21 ⟹ U
- A ( 1 ) + 3 = 4 ⟹ D A(1) + 3 = 4 \implies D A ( 1 ) + 3 = 4 ⟹ D
- C ( 3 ) + 3 = 6 ⟹ F C(3) + 3 = 6 \implies F C ( 3 ) + 3 = 6 ⟹ F
- K ( 11 ) + 3 = 14 ⟹ N K(11) + 3 = 14 \implies N K ( 11 ) + 3 = 14 ⟹ N
The encrypted output is WUDFN .
2. Progressive and Variable Shifts
More complex test items vary the shift value progressively based on the letter's position within the word. Common variations include:
Incremental Step Shifts: The first letter shifts by + 1 +1 + 1 , the second by + 2 +2 + 2 , the third by + 3 +3 + 3 , and so forth.
Alternating Shifts: Odd positions shift forward ( + 2 +2 + 2 ) while even positions shift backward ( − 1 -1 − 1 ).
Note
Consider the word BRAVO encrypted with a progressive shift ( + 1 , + 2 , + 3 , + 4 , + 5 +1, +2, +3, +4, +5 + 1 , + 2 , + 3 , + 4 , + 5 ):
- B ( 2 ) + 1 = 3 ⟹ C B(2) + 1 = 3 \implies C B ( 2 ) + 1 = 3 ⟹ C
- R ( 18 ) + 2 = 20 ⟹ T R(18) + 2 = 20 \implies T R ( 18 ) + 2 = 20 ⟹ T
- A ( 1 ) + 3 = 4 ⟹ D A(1) + 3 = 4 \implies D A ( 1 ) + 3 = 4 ⟹ D
- V ( 22 ) + 4 = 26 ⟹ Z V(22) + 4 = 26 \implies Z V ( 22 ) + 4 = 26 ⟹ Z
- O ( 15 ) + 5 = 20 ⟹ T O(15) + 5 = 20 \implies T O ( 15 ) + 5 = 20 ⟹ T
Encrypted ciphertext: CTDZT .
When encountering an unfamiliar shift puzzle, calculate the numerical displacements of the first three letters immediately. If the displacements are identical (e.g., + 2 , + 2 , + 2 +2, +2, +2 + 2 , + 2 , + 2 ), it is a uniform shift; if they increase (e.g., + 1 , + 2 , + 3 +1, +2, +3 + 1 , + 2 , + 3 ), the pattern is progressive.
Opposite-Letter Complement Ciphers
A common cipher type on reasoning tests is the opposite-letter or complementary substitution cipher. In this system, each letter is replaced by its paired counterpart situated at the equidistant opposite position of the alphabet.
The Mathematical Principle of 27
Because the alphabet comprises 26 letters, pairing the first letter with the twenty-sixth, the second with the twenty-fifth, and so on, creates a fixed mathematical relationship: Position of Letter + Position of Opposite Letter = 27 \text{Position of Letter} + \text{Position of Opposite Letter} = 27 Position of Letter + Position of Opposite Letter = 27 Opposite Position = 27 − Forward Position \text{Opposite Position} = 27 - \text{Forward Position} Opposite Position = 27 − Forward Position
Comprehensive Opposite-Letter Key
- Pair Forward Index Complement Index Memory Mnemonic
- A – Z 1 26 A to Z
- B – Y 2 25 B o y
- C – X 3 24 C omple x
- D – W 4 23 D e w
- E – V 5 22 E vening ( EV )
- F – U 6 21 F ull ( FU )
- G – T 7 20 G hana T raining
- H – S 8 19 H igh S chool
- I – R 9 18 I nter- R egional
- J – Q 10 17 J ack - Q ueen
- K – P 11 16 K ee p
- L – O 12 15 L ove ( LO )
- M – N 13 14 M a n
If BORDER is coded using this cipher: B ↔ Y B \leftrightarrow Y B ↔ Y , O ↔ L O \leftrightarrow L O ↔ L , R ↔ I R \leftrightarrow I R ↔ I , D ↔ W D \leftrightarrow W D ↔ W , E ↔ V E \leftrightarrow V E ↔ V , R ↔ I R \leftrightarrow I R ↔ I , producing YLIWVI . Memorizing these 13 reciprocal pairs eliminates the need to sketch out the entire alphabet on scratch paper.
Direct Symbol & Number Substitutions
In direct substitution systems, characters are mapped directly to arbitrary numerals or punctuation symbols without an algebraic progression. Each unique plaintext letter retains a constant token assignment throughout the puzzle.
Identifying Direct Substitutions
Direct substitution is signaled when candidates are given two sample encoded words and asked to determine the code for a third word composed exclusively of letters from the samples.
For example, given:
- GUARD is coded as 7 − 5 − 1 − 9 − 4 7 - 5 - 1 - 9 - 4 7 − 5 − 1 − 9 − 4
- POINT is coded as 8 − 3 − 6 − 2 − 0 8 - 3 - 6 - 2 - 0 8 − 3 − 6 − 2 − 0
To find the code for RADIO :
- Extract R R R from GUARD: R = 9 R = 9 R = 9
- Extract A A A from GUARD: A = 1 A = 1 A = 1
- Extract D D D from GUARD: D = 4 D = 4 D = 4
- Extract I I I from POINT: I = 6 I = 6 I = 6
- Extract O O O from POINT: O = 3 O = 3 O = 3
- Assembled code for RADIO : 9 − 1 − 4 − 6 − 3 9 - 1 - 4 - 6 - 3 9 − 1 − 4 − 6 − 3
Tip
Always verify that repeated letters across both sample words share the identical symbol or number. If the letter R R R appears in both sample words but corresponds to different digits, the cipher is governed by positional arithmetic rather than direct assignment.
Positional Transposition Ciphers
Transposition ciphers do not alter the identity of letters; instead, they rearrange the positions of characters according to a geometric permutation rule.
Full Word Inversion: Plaintext is written in reverse order. For example, SOLDIER becomes REIDLOS .
Split-Half Inversion (Even Lengths): A word is bisected into two equal halves, and each half is reversed independently. For example, PATROL (6 letters) divides into PAT and ROL . Inverting each half yields TAP and LOR , forming TAPLOR .
Odd-Length Center Pivot: In odd-length words, the central letter remains fixed while flanking segments are inverted. For example, DEFENCE (7 letters): the central letter is E (position 4). Inverting the first half ( DEF ⟹ \implies ⟹ FED ) and second half ( NCE ⟹ \implies ⟹ ECN ) while keeping E stationary produces FEDEECN .
Adjacent Pair Swapping: Successive pairs of letters swap places ( 1 ↔ 2 1 \leftrightarrow 2 1 ↔ 2 , 3 ↔ 4 3 \leftrightarrow 4 3 ↔ 4 , 5 ↔ 6 5 \leftrightarrow 6 5 ↔ 6 ). For example, SIGNAL becomes ISNGLA ( S − I ⟹ I − S S-I \implies I-S S − I ⟹ I − S ; G − N ⟹ N − G G-N \implies N-G G − N ⟹ N − G ; A − L ⟹ L − A A-L \implies L-A A − L ⟹ L − A ).
Artificial / Fictitious Language Decoding
Fictitious language puzzles present 3 or 4 short phrases written in an imaginary tongue accompanied by their English translations. The word order in the artificial language does not necessarily correspond to the English word order. To solve these, apply the method of comparative elimination.
Step-by-Step Tactical Walkthrough
Given the three operational statements:
- "mor tik kex" means "reinforce northern flank"
- "tik dal zep" means "secure northern bridge"
- "kex zep run" means "patrol flank bridge"
Step 1: Cross-reference Statement 1 and Statement 2:
- Common code token: "tik"
- Common English word: "northern"
- Deduction: "tik" = "northern"
Step 2: Cross-reference Statement 1 and Statement 3:
- Common code token: "kex"
- Common English word: "flank"
- Deduction: "kex" = "flank"
Step 3: Resolve Remaining Vocabulary in Statement 1:
With "tik" ( northern ) and "kex" ( flank ) accounted for, the sole remaining code word is "mor" , and the sole remaining English word is "reinforce" .
Deduction: "mor" = "reinforce"
Step 4: Cross-reference Statement 2 and Statement 3:
- Common code token: "zep"
- Common English word: "bridge"
- Deduction: "zep" = "bridge"
Step 5: Resolve Remaining Words in Statements 2 and 3:
In Statement 2, "dal" remains ⟹ \implies ⟹ "dal" = "secure" .
In Statement 3, "run" remains ⟹ \implies ⟹ "run" = "patrol" .
This structured extraction isolates every vocabulary pair without guesswork.
Cipher Diagnostic Decision Table
Cipher Category Key Identifying Feature Primary Scratchpad Action Common Distractor Traps
Uniform Shift All characters advance by a constant step ( + k +k + k ) Compute C 1 − P 1 C_1 - P_1 C 1 − P 1 and confirm on C 2 − P 2 C_2 - P_2 C 2 − P 2 Forgetting alphabet wrap-around past Z Z Z
Progressive Shift Shift increments by position ( + 1 , + 2 , + 3 +1, +2, +3 + 1 , + 2 , + 3 ) Compute shifts for first 3 positions Assuming uniform shift from only testing position 1
Opposite Complement Paired letters sum to 27 ( A ↔ Z A \leftrightarrow Z A ↔ Z ) Check against the Rule of 27 Confusing reverse alphabet with simple negative shift
Direct Substitution Target word composed of sample letters Build direct letter-to-symbol lookup table Searching for mathematical formula when mapping is direct
Transposition Letters in cipher identical to plaintext Trace original character index positions Assuming letters were replaced rather than rearranged
Fictitious Language Multi-word phrases with English equivalents Cross-compare statements to find common words Assuming 1-to-1 word order matching English grammar