|
| 1 | +--- |
| 2 | +title: "Titanic Time-Rift Escape Room - Course Assignment Showcase" |
| 3 | +published: 2025-11-06 |
| 4 | +updated: 2025-11-06 |
| 5 | +pinned: false |
| 6 | +image: '' |
| 7 | +description: "A course project showcasing an interactive data science escape room game. This assignment combines storytelling with hands-on challenges in anomaly detection, survival analysis, cryptography, and outlier detection using the Titanic dataset." |
| 8 | +tags: ["course assignment", "data science", "python", "assignment showcase", "interactive learning"] |
| 9 | +category: course assignment |
| 10 | +draft: false |
| 11 | +--- |
| 12 | + |
| 13 | + |
| 14 | +# The Titanic Time-Rift Escape Room |
| 15 | +## A Data Science Adventure Game |
| 16 | + |
| 17 | +--- |
| 18 | + |
| 19 | +## � Live Demo |
| 20 | + |
| 21 | +**[View Game Master Guide (Live Demo)](https://sharp-cloud-uploader-nine.vercel.app/gm_guide.html)** |
| 22 | + |
| 23 | +*Click the link above to see the interactive HTML version of the game with all challenges, visualizations, and examples.* |
| 24 | + |
| 25 | +--- |
| 26 | + |
| 27 | +## �🌌 Story Background |
| 28 | + |
| 29 | +### Theme: The Titanic Time-Rift |
| 30 | + |
| 31 | +**Your Role:** You are a group of time-travelers. During a routine jump, your temporal engines malfunctioned, causing an emergency ejection. You've landed on the RMS Titanic on April 14, 1912, just hours before it sinks. |
| 32 | + |
| 33 | +**Your Goal:** Your time machine is "phased," and to bring it back into your timeline, you must find **4 "Temporal Coordinate Fragments"** that were scattered across the ship during your crash-landing. You must collect all 4 and get to the rendezvous point before the ship sinks. |
| 34 | + |
| 35 | +**The Challenge:** Each fragment is hidden behind a data analysis puzzle. Only by applying real data science skills can you unlock them and escape your fate. |
| 36 | + |
| 37 | +--- |
| 38 | + |
| 39 | +## 🧩 Challenge 1: The Purser's Office |
| 40 | +### Finding the Forged Passenger Card |
| 41 | + |
| 42 | +### Story |
| 43 | +You've just boarded and been caught as stowaways. You're locked in the **Purser's Office**. On the desk is a stack of passenger registration cards. To prove your intelligence and earn your freedom, you must identify the **forged card** among them. |
| 44 | + |
| 45 | +### Challenge |
| 46 | +- **Task:** Identify 1 forged card among 6 passenger registration cards |
| 47 | +- **Data:** 5 cards contain authentic passenger data from the Titanic dataset |
| 48 | +- **Anomaly:** 1 card is statistically impossible - a cleverly generated anomaly |
| 49 | + |
| 50 | +### Technical Details |
| 51 | + |
| 52 | +#### Data Processing |
| 53 | +1. Load authentic Titanic dataset (891 passengers) |
| 54 | +2. Filter passengers with valid fare data (Fare > 0) |
| 55 | +3. Randomly sample 5 authentic passengers |
| 56 | +4. Calculate fare statistics by passenger class: |
| 57 | + - **1st Class:** £5.00 - £512.33 (median: £61.98) |
| 58 | + - **2nd Class:** £10.50 - £73.50 (median: £15.02) |
| 59 | + - **3rd Class:** £4.01 - £69.55 (median: £8.05) |
| 60 | + |
| 61 | +#### Forged Data Generation |
| 62 | +The algorithm creates **statistically impossible combinations** where the fare completely falls outside the valid range for that class: |
| 63 | + |
| 64 | +**6 Possible Anomaly Types:** |
| 65 | +- **1st Class:** Too high (£522-£666) OR too low (£0.50-£4.50) |
| 66 | +- **2nd Class:** Too high (£74-£110) OR too low (£0.50-£10.00) |
| 67 | +- **3rd Class:** Too high (£70-£90) OR too low (£0.50-£3.51) |
| 68 | + |
| 69 | +**Design Principle:** Zero overlap ensures the anomaly is always detectable through statistical analysis. |
| 70 | + |
| 71 | +### Player Experience |
| 72 | +- **Display:** 6 passenger cards (Name, Class, Age, Sex, Fare, Embarked) |
| 73 | +- **Hint:** Box plot showing authentic fare distributions by class (min, max, median) |
| 74 | +- **Solution:** Compare each card's fare against the box plot to find which falls outside the expected range |
| 75 | + |
| 76 | +### Visual Examples |
| 77 | + |
| 78 | +**Box Plot Hint Chart:** |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | +*Caption: Statistical visualization showing min, max, and median fares for each passenger class* |
| 83 | + |
| 84 | +--- |
| 85 | + |
| 86 | +**Game Interface Screenshot:** |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | +*Caption: Players see 6 passenger cards and must identify the forged one* |
| 91 | + |
| 92 | +--- |
| 93 | + |
| 94 | +### Example from Generated Game |
| 95 | + |
| 96 | +**Real Passenger Cards (5):** |
| 97 | +1. West, Mrs. Edwy Arthur - 2nd Class, £27.75 |
| 98 | +2. Charters, Mr. David - 3rd Class, £7.73 |
| 99 | +3. Asplund, Miss. Lillian Gertrud - 3rd Class, £31.39 |
| 100 | +4. Rice, Master. Eugene - 3rd Class, £29.12 |
| 101 | +5. Maisner, Mr. Simon - 3rd Class, £8.05 |
| 102 | + |
| 103 | +**Forged Card (1):** |
| 104 | +- **Ryerson, Miss. Emily Borie - 2nd Class, £100.76** ❌ |
| 105 | +- **Why it's impossible:** 2nd class fares range from £10.50-£73.50, but this card shows £100.76, which is **far above the maximum** |
| 106 | + |
| 107 | +### Reward |
| 108 | +**✨ Temporal Coordinate Fragment 1 ✨** - Hidden beneath the forged card |
| 109 | + |
| 110 | +--- |
| 111 | + |
| 112 | +## 🧩 Challenge 3: Decipher the Lifeboat Code |
| 113 | +### Survival Probability Analysis |
| 114 | + |
| 115 | +### Story |
| 116 | +You've reached the **Lifeboat Control Room**. The control console demands a mysterious **4-digit binary code** to activate the final escape system. You must deduce the code based on passenger survival analysis from Titanic dataset clues. |
| 117 | + |
| 118 | +### Challenge |
| 119 | +- **Task:** Predict which of 4 passengers survived (1) or perished (0) |
| 120 | +- **Data:** 4 passenger cards with Name, Pclass, Age, Sex, Fare, Embarked |
| 121 | +- **Output:** A 4-bit binary code (e.g., "1001") |
| 122 | + |
| 123 | +### Technical Details |
| 124 | + |
| 125 | +#### Data Analysis |
| 126 | +Players are provided with two analytical tools: |
| 127 | + |
| 128 | +**1. Survival Probability by Sex & Pclass** |
| 129 | + |
| 130 | +| Sex | Class | Survival Rate | |
| 131 | +|------|-------|----------------| |
| 132 | +| Female | 1st | 96.8% | |
| 133 | +| Female | 2nd | 92.1% | |
| 134 | +| Female | 3rd | 50.0% | |
| 135 | +| Male | 1st | 36.9% | |
| 136 | +| Male | 2nd | 15.7% | |
| 137 | +| Male | 3rd | 13.5% | |
| 138 | + |
| 139 | +**Insight:** Female passengers and higher-class travelers had a strong survival advantage. |
| 140 | + |
| 141 | +**2. Survival Probability by Age Group** |
| 142 | + |
| 143 | +| Age Group | Survival Rate | |
| 144 | +|------------|----------------| |
| 145 | +| < 10 | 61.3% | |
| 146 | +| 10–20 | 40.2% | |
| 147 | +| 20–40 | 38.8% | |
| 148 | +| 40–60 | 39.4% | |
| 149 | +| 60+ | 26.9% | |
| 150 | + |
| 151 | +**Insight:** Younger passengers had slightly higher chances of survival. |
| 152 | + |
| 153 | +#### Code Generation Logic |
| 154 | +- At least 1 survivor and 1 deceased among the 4 passengers |
| 155 | +- Players analyze each passenger using survival statistics |
| 156 | +- Form binary code: `1` = likely survived, `0` = likely did not survive |
| 157 | + |
| 158 | +### Player Experience |
| 159 | +- **Display:** 4 passenger cards |
| 160 | +- **Hints:** Interactive survival rate charts (heatmap + bar chart) |
| 161 | +- **Solution:** Apply statistical reasoning to predict each passenger's fate |
| 162 | + |
| 163 | +### Visual Examples |
| 164 | + |
| 165 | +**Survival Rate Heatmap (Sex vs Pclass):** |
| 166 | + |
| 167 | + |
| 168 | + |
| 169 | +*Caption: Heatmap showing survival probabilities based on gender and passenger class* |
| 170 | + |
| 171 | +--- |
| 172 | + |
| 173 | +**Survival Rate Bar Chart (Age Groups):** |
| 174 | + |
| 175 | + |
| 176 | + |
| 177 | +*Caption: Bar chart displaying survival rates across different age groups* |
| 178 | + |
| 179 | +--- |
| 180 | + |
| 181 | +**Game Interface Screenshot:** |
| 182 | + |
| 183 | + |
| 184 | + |
| 185 | +*Caption: Players analyze 4 passenger cards with survival statistics to deduce the binary code* |
| 186 | + |
| 187 | +--- |
| 188 | + |
| 189 | +### Example from Generated Game |
| 190 | + |
| 191 | +**Passenger Cards:** |
| 192 | +1. **Fox, Mr. Stanley Hubert** - 2nd Class, Male, Age 36 |
| 193 | + - Prediction: `0` (Male, 2nd Class = 15.7% survival rate) |
| 194 | + |
| 195 | +2. **Goldsmith, Mrs. Frank John** - 3rd Class, Female, Age 31 |
| 196 | + - Prediction: `1` (Female, 3rd Class = 50.0% survival rate) |
| 197 | + |
| 198 | +3. **Warren, Mrs. Frank Manley** - 1st Class, Female, Age 60 |
| 199 | + - Prediction: `1` (Female, 1st Class = 96.8% survival rate) |
| 200 | + |
| 201 | +4. **Nye, Mrs. (Elizabeth Ramell)** - 2nd Class, Female, Age 29 |
| 202 | + - Prediction: `1` (Female, 2nd Class = 92.1% survival rate) |
| 203 | + |
| 204 | +**Correct Code:** `0111` ✅ |
| 205 | + |
| 206 | +### Reward |
| 207 | +**✨ Temporal Coordinate Fragment 2 ✨** - Unlocked from the lifeboat console |
| 208 | + |
| 209 | +--- |
| 210 | + |
| 211 | +## 🧩 Challenge 4: Letters from a Stowaway |
| 212 | +### Monoalphabetic Cipher Decryption |
| 213 | + |
| 214 | +### Story |
| 215 | +The Captain has called you to the deck with an urgent mission. Telegrams have been intercepted from the ship's Marconi machine—there's a **stowaway** on board! The dastardly stowaway has scrambled one telegram using a mysterious code. The Captain has created a list of 10 suspects. Can you decipher the letter and identify the stowaway before they get away? |
| 216 | + |
| 217 | +### Challenge |
| 218 | +- **Task:** Decode an encrypted letter and identify the stowaway from a list of suspects |
| 219 | +- **Given to Player:** |
| 220 | + - An unencrypted intercepted letter |
| 221 | + - An encrypted letter (same sender, different content) |
| 222 | + - A list of 10 possible suspect names |
| 223 | + - An automatic decoder (optional hint) |
| 224 | +- **Goal:** Decrypt the message to reveal passenger information (class, fare, age), then match to the correct suspect |
| 225 | + |
| 226 | +### Technical Details |
| 227 | + |
| 228 | +#### Encryption Method |
| 229 | +- **Type:** Monoalphabetic substitution cipher |
| 230 | +- **Key Generation:** Randomly shuffled 26-letter alphabet |
| 231 | +- **Example Mapping:** |
| 232 | + - Plain: `abcdefghijklmnopqrstuvwxyz` |
| 233 | + - Cipher: `qwertyuiopasdfghjklzxcvbnm` |
| 234 | + |
| 235 | +#### Algorithms Required |
| 236 | +1. **Encryption algorithm** - Substitute each letter according to cipher key |
| 237 | +2. **Key generation algorithm** - Randomly shuffle alphabet to create cipher key |
| 238 | +3. **Passenger selection algorithm** - Ensure selected passenger is unique in the dataset |
| 239 | +4. **Message splicing algorithm** - Embed passenger information into the encrypted letter |
| 240 | +5. **Decoder algorithm** (optional hint) - Help players break the cipher |
| 241 | + |
| 242 | +#### How to Solve |
| 243 | +1. **Compare** the unencrypted letter to the encrypted letter |
| 244 | +2. **Find common phrases** between the two (big hint: "R.M.S. TITANIC" and "APRIL 12, 1912" at the top of both) |
| 245 | +3. **Map letters** - Determine which cipher letter corresponds to which plaintext letter |
| 246 | +4. **Decrypt the message** - Use the discovered mapping to decode the encrypted letter |
| 247 | +5. **Extract information** - Find passenger details (class, fare, age) in the decrypted message |
| 248 | +6. **Match to suspect** - Select the correct name from the list of 10 suspects |
| 249 | + |
| 250 | +### Player Experience |
| 251 | +- **Display:** Two letters side-by-side (one encrypted, one not) |
| 252 | +- **Hint:** Optional automatic decoder tool |
| 253 | +- **Solution:** Pattern matching and frequency analysis to break the cipher |
| 254 | + |
| 255 | +### Visual Examples |
| 256 | + |
| 257 | +**Game Interface Screenshot:** |
| 258 | + |
| 259 | + |
| 260 | + |
| 261 | +*Caption: Players compare the intercepted letter with the encrypted letter to break the cipher* |
| 262 | + |
| 263 | + |
| 264 | +--- |
| 265 | + |
| 266 | +### Example from Generated Game |
| 267 | + |
| 268 | +**Intercepted Letter (Plaintext):** |
| 269 | +``` |
| 270 | +R.M.S. TITANIC |
| 271 | +MARCONI WIRELESS SERVICE |
| 272 | +APRIL 12, 1912 |
| 273 | +To Mr. David Smith |
| 274 | +Good afternoon, I have snuck aboard this mighty vessel. |
| 275 | +Now time to implement my darstardly plan! |
| 276 | +Yours Sincerely, |
| 277 | +
|
| 278 | +A Guest of the Deep |
| 279 | +``` |
| 280 | + |
| 281 | +**Encrypted Letter (Ciphertext):** |
| 282 | +``` |
| 283 | +c.s.r. yfytbfd |
| 284 | +stcdibf lfckhkrr rkcufdk |
| 285 | +tecfh 12, 1912 |
| 286 | +sq rkdcky thftr fr sc jtskr sictb |
| 287 | +
|
| 288 | +t mxkry ia yvk okke |
| 289 | +``` |
| 290 | + |
| 291 | +**Solution Process:** |
| 292 | +1. Notice "R.M.S. TITANIC" → "c.s.r. yfytbfd" |
| 293 | +2. Map letters: R→c, M→s, S→r, T→y, I→f, etc. |
| 294 | +3. Build complete cipher key |
| 295 | +4. Decrypt hidden message revealing passenger identity |
| 296 | +5. Match to suspect list |
| 297 | + |
| 298 | +### Reward |
| 299 | +**✨ Temporal Coordinate Fragment 3 ✨** - Hidden in the decoded message |
| 300 | + |
| 301 | +--- |
| 302 | + |
| 303 | +## 🧩 Challenge 5: Identify the Saboteurs |
| 304 | +### LLM-Generated Cryptic Clues & Outlier Detection |
| 305 | + |
| 306 | +### Story |
| 307 | +Two time-traveling imposters have taken the final temporal fragment and hidden it. A friend at Time Traveling HQ sent a transmission naming these imposters. However, enemy time travelers intercepted and warped the transmission. Now it only contains cryptic hints. Furthermore, the imposters added hints to non-saboteur passengers. Your task has two parts. |
| 308 | + |
| 309 | +### Challenge Part 1: Decode Cryptic Messages |
| 310 | + |
| 311 | +#### Task |
| 312 | +- **Given:** 4 cryptic messages generated by LLM |
| 313 | +- **Data:** 2 real passengers + 2 fake passengers from a suspect list |
| 314 | +- **Goal:** Identify which passenger each cryptic hint refers to |
| 315 | + |
| 316 | +#### Example Clues |
| 317 | +- **Clue 1:** "She moves quietly through folded hours, stitching torn timelines with grace. Her touch repairs what the centuries unravel, though she herself remains a patch upon the fabric of memory." |
| 318 | + - **Answer:** Rugg, Miss. Emily |
| 319 | + |
| 320 | +- **Clue 2:** "He pens the minutes like chapters, his words binding moments that refuse to stay still. Yet even he cannot edit the fate that writes itself between his lines." |
| 321 | + - **Answer:** Novel, Mr. Mansouer |
| 322 | + |
| 323 | +- **Clue 3:** "A gentleman who counts shadows instead of stars, claiming to chart constellations no one else can see. His maps lead only in circles, drawn with ink that fades before dawn." |
| 324 | + - **Answer:** Cartwright, Mr. Silas (FAKE) |
| 325 | + |
| 326 | +- **Clue 4:** "Her laughter rings like chimes at the edge of perception—sweet at first, then hollow. Those who follow her melody find themselves wandering through echo instead of song." |
| 327 | + - **Answer:** Bellamy, Miss. Cora (FAKE) |
| 328 | + |
| 329 | +### Challenge Part 2: Expose Data Anomalies |
| 330 | + |
| 331 | +#### Task |
| 332 | +The enemy time-travelers forged database entries for the imposters, but entered anomalous family data values for siblings/spouses (`SibSp`) and parents/children (`Parch`). |
| 333 | + |
| 334 | +#### How to Solve |
| 335 | +- **Display:** Box-and-whisker plots for both `SibSp` and `Parch` |
| 336 | +- **Analysis:** Compare each suspect's family counts with the rest of the Titanic passengers |
| 337 | +- **Detection:** Passengers whose values lie far outside the normal range (outliers on box plots) are the forged, fake records (the imposters) |
| 338 | +- **Conclusion:** The others, whose data fall within typical ranges, are real passengers |
| 339 | + |
| 340 | +### Player Experience |
| 341 | +- **Part 1:** LLM-generated riddles requiring creative interpretation |
| 342 | +- **Part 2:** Data visualization analysis (box plots) |
| 343 | +- **Solution:** Combine linguistic reasoning with statistical outlier detection |
| 344 | + |
| 345 | + |
| 346 | + |
| 347 | +### Reward |
| 348 | +**✨ Temporal Coordinate Fragment 4 ✨** - Recovered from the imposters |
| 349 | + |
| 350 | +--- |
| 351 | + |
| 352 | +## 🎯 Game Summary |
| 353 | + |
| 354 | +### Learning Objectives |
| 355 | +This escape room teaches essential data science skills through immersive gameplay: |
| 356 | + |
| 357 | +1. **Anomaly Detection** (Challenge 1) - Statistical distributions and data validation |
| 358 | +2. **Predictive Analysis** (Challenge 3) - Probability and correlation analysis |
| 359 | +3. **Pattern Recognition** (Challenge 4) - Cryptography and string manipulation |
| 360 | +4. **Outlier Detection** (Challenge 5) - Box plot interpretation and NLP reasoning |
| 361 | + |
| 362 | +### Technical Stack |
| 363 | +- **Language:** Python |
| 364 | +- **Libraries:** Pandas, Seaborn, Matplotlib |
| 365 | +- **Data:** Titanic dataset (891 passengers) |
| 366 | +- **Output:** JSON data + HTML visualization |
| 367 | +- **AI:** LLM integration for cryptic clue generation |
| 368 | + |
| 369 | +### Success Criteria |
| 370 | +Collect all **4 Temporal Coordinate Fragments** by solving data challenges, repair the time machine, and escape before the Titanic sinks! |
| 371 | + |
| 372 | +--- |
| 373 | + |
| 374 | +**🚢 The clock is ticking... Can you escape in time? ⏰** |
| 375 | + |
0 commit comments