# πŸ”’ Mastering Unit Digit Problems ## The Problem > **X** and **Y** are the digits at the unit's place of the numbers **(408X)** and **(789Y)** where **X β‰  Y**. > However, the digits at the unit's place of **(408X)^63** and **(789Y)^85** are the same. > **What will be the possible value(s) of (X + Y)?** --- ## πŸ“š Prerequisites ### 1. Base & Exponent In the expression **2⁸** (read as "two raised to the power of 8"): - **2** is the **base** - **8** is the **exponent** --- ### 2. PEW β€” Power Ends With **PEW** is a term we'll use to describe the **cyclical pattern** of unit digits when a number is raised to successive powers. | Base | PEW (Power Ends With) | Meaning | |:----:|:---------------------:|:--------| | 1 | (1) | Any power of 1 ends in **1** | | 2 | (2, 4, 8, 6) | Powers of 2 cycle through these digits | | 3 | (3, 9, 7, 1) | Powers of 3 cycle through these digits | | ... | ... | ... | #### ⚠️ Important! **PEW is an ordered sequence, not just a set.** The order matters because it tells us the *next* unit digit for consecutive powers. **Example:** If 2¹⁰ = 1024 (ends in 4), then 2ΒΉΒΉ ends in **8** (next in the cycle). --- ### 3. The Golden Property of PEW > **To find the unit digit of a large number in base^exponent form, only consider the last digit of the base.** | Expression | Simplifies To | Why? | |:----------:|:-------------:|:-----| | 12345678¹⁰⁴ | 8¹⁰⁴ | Only the unit digit (8) matters | | 123456789ΒΉΒ²Β³ | 9ΒΉΒ²Β³ | Only the unit digit (9) matters | | 408X⁢³ | X⁢³ | Only X determines the unit digit | --- ### 4. Modular Arithmetic Think of **modulo** as finding the **remainder** after division. > πŸ• **Real-world example:** Clocks use mod 12, so 13:00 becomes 1:00 PM. | Expression | Value | Explanation | |:----------:|:-----:|:------------| | 1 mod 4 | 1 | 1 Γ· 4 = 0 remainder **1** | | 5 mod 4 | 1 | 5 Γ· 4 = 1 remainder **1** | | 8 mod 4 | 0 | 8 Γ· 4 = 2 remainder **0** | | 100 mod 4 | 0 | Perfect division | **Key insight:** `n mod X` always gives a value between **0** and **X-1**. --- ## πŸ”— Connecting PEW and Modulo Here's where the magic happens! ### Building the PEW Table for Base 2 | Power | Value | Unit Digit | Position in Cycle | |:-----:|:-----:|:----------:|:-----------------:| | 2ΒΉ | 2 | 2 | 1st | | 2Β² | 4 | 4 | 2nd | | 2Β³ | 8 | 8 | 3rd | | 2⁴ | 16 | 6 | 4th | | 2⁡ | 32 | 2 | 1st ↩️ | | 2⁢ | 64 | 4 | 2nd | | 2⁷ | 128 | 8 | 3rd | | 2⁸ | 256 | 6 | 4th | **PEW(2) = (2, 4, 8, 6)** β€” cycle length = **4** --- ### πŸ’‘ The Formula > **To find the unit digit of base^n:** > 1. Find PEW of the base's unit digit > 2. Calculate: `n mod (PEW size)` > 3. Look up that position in the PEW cycle #### Example 1: What does 2¹⁰⁰ end with? ``` PEW(2) = (2, 4, 8, 6) β†’ size = 4 100 mod 4 = 0 β†’ means "4th position" (0 = complete cycle) Answer: 6 βœ“ ``` #### Example 2: What does 2¹⁰¹ end with? ``` PEW(2) = (2, 4, 8, 6) β†’ size = 4 101 mod 4 = 1 β†’ 1st position Answer: 2 βœ“ ``` Visualizing 2⁹⁷ through 2¹⁰¹: ``` 2⁹⁷ = ...2 (position 1) 2⁹⁸ = ...4 (position 2) 2⁹⁹ = ...8 (position 3) 2¹⁰⁰ = ...6 (position 4) 2¹⁰¹ = ...2 (position 1) ↩️ cycle restarts ``` --- ## 🎯 Solving the Original Problem ### Step 1: Simplify the Problem From the problem: - Unit digit of **(408X)⁢³** = Unit digit of **X⁢³** - Unit digit of **(789Y)⁸⁡** = Unit digit of **Y⁸⁡** **Reframed problem:** > Find X and Y (where X β‰  Y) such that **X⁢³** and **Y⁸⁡** have the **same unit digit**. --- ### Step 2: Build the Complete PEW Table | Base | PEW | Cycle Size | |:----:|:---:|:----------:| | 0 | (0) | 1 | | 1 | (1) | 1 | | 2 | (2, 4, 8, 6) | 4 | | 3 | (3, 9, 7, 1) | 4 | | 4 | (4, 6) | 2 | | 5 | (5) | 1 | | 6 | (6) | 1 | | 7 | (7, 9, 3, 1) | 4 | | 8 | (8, 4, 2, 6) | 4 | | 9 | (9, 1) | 2 | --- ### Step 3: Calculate Mod Values For **X⁢³**: ``` 63 mod 4 = 3 β†’ for bases with cycle size 4 63 mod 2 = 1 β†’ for bases with cycle size 2 ``` For **Y⁸⁡**: ``` 85 mod 4 = 1 β†’ for bases with cycle size 4 85 mod 2 = 1 β†’ for bases with cycle size 2 ``` --- ### Step 4: Compute Unit Digits for Each Base | Base | PEW | X⁢³ ends with | Y⁸⁡ ends with | |:----:|:---:|:-------------:|:-------------:| | 0 | (0) | 0 | 0 | | 1 | (1) | 1 | 1 | | 2 | (2, 4, 8, 6) | **8** ← 3rd position | **2** ← 1st position | | 3 | (3, 9, 7, 1) | **7** ← 3rd position | **3** ← 1st position | | 4 | (4, 6) | **4** ← 1st position | **4** ← 1st position | | 5 | (5) | 5 | 5 | | 6 | (6) | 6 | 6 | | 7 | (7, 9, 3, 1) | **3** ← 3rd position | **7** ← 1st position | | 8 | (8, 4, 2, 6) | **2** ← 3rd position | **8** ← 1st position | | 9 | (9, 1) | **9** ← 1st position | **9** ← 1st position | --- ### Step 5: Find Matching Pairs We need: **X⁢³ unit digit = Y⁸⁡ unit digit** where **X β‰  Y** Looking for matches **across different rows**: | X⁢³ ends with | Y⁸⁡ ends with | X | Y | Match? | |:-------------:|:-------------:|:-:|:-:|:------:| | 8 | 8 | 2 | 8 | βœ… | | 7 | 7 | 3 | 7 | βœ… | | 3 | 3 | 7 | 3 | βœ… | | 2 | 2 | 8 | 2 | βœ… | --- ## ✨ Solution ### Valid (X, Y) Pairs: | X | Y | X⁢³ ends with | Y⁸⁡ ends with | X + Y | |:-:|:-:|:-------------:|:-------------:|:-----:| | 2 | 8 | 8 | 8 | **10** | | 3 | 7 | 7 | 7 | **10** | | 7 | 3 | 3 | 3 | **10** | | 8 | 2 | 2 | 2 | **10** | --- ## πŸŽ‰ Final Answer $$\boxed{X + Y = 10}$$ --- ## 🧠 Key Takeaways 1. **Only the unit digit of the base matters** when finding unit digits of powers. 2. **PEW sizes are limited:** Only 1, 2, or 4 β€” so we only need to mod by 2 or 4. 3. **The "swap pattern":** When power positions differ (like 3rd vs 1st in a cycle-4): - 2 ↔ 8 (both sum to 10) - 3 ↔ 7 (both sum to 10) 4. **This is why X + Y = 10 appears so frequently** in these problems! --- ## πŸ“ Quick Reference: PEW Table ``` β”Œβ”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Base β”‚ PEW β”‚ Size β”‚ β”œβ”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ 0 β”‚ (0) β”‚ 1 β”‚ β”‚ 1 β”‚ (1) β”‚ 1 β”‚ β”‚ 2 β”‚ (2,4,8,6) β”‚ 4 β”‚ β”‚ 3 β”‚ (3,9,7,1) β”‚ 4 β”‚ β”‚ 4 β”‚ (4,6) β”‚ 2 β”‚ β”‚ 5 β”‚ (5) β”‚ 1 β”‚ β”‚ 6 β”‚ (6) β”‚ 1 β”‚ β”‚ 7 β”‚ (7,9,3,1) β”‚ 4 β”‚ β”‚ 8 β”‚ (8,4,2,6) β”‚ 4 β”‚ β”‚ 9 β”‚ (9,1) β”‚ 2 β”‚ β””β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ``` --- *Happy Problem Solving! πŸš€*