You’re given a tabular dataset with several numeric columns and a label. Your job is to reveal a hidden hint via PCA, then use that hint to locate and decode the flag.
Load the dataset and separate all feature columns from the label column.
Run PCA on the features (exclude the label).
Scatter-plot the first two principal components; color points by label.
Observe that the points with label == 0 form readable text in the PCA plane: “MIDDLE ZERO” (see the provided figure).
This teaches the rule for Phase 2: look at the middle feature column (named e) when label is 0.
(This mapping and the same “look in column e for label==0” extraction approach appears in the reference solver files.
solution_2d)
# Phase 1: PCA reveal
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA
# Load data
df = pd.read_csv("dataset_new.csv")
# Split features vs. label (drop the label column)
feature_cols = [c for c in df.columns if c != "label"]
X = df[feature_cols].values
y = df["label"].values
# 2D PCA
pca = PCA(n_components=2)
X_pca = pca.fit_transform(X)
# Plot: color by label, highlight label==0 (the text)
plt.figure(figsize=(10, 7))
colors = {0: "red", 1: "lightblue", 2: "lightgreen"}
for lab in sorted(np.unique(y)):
mask = (y == lab)
size = 30 if lab == 0 else 6
alpha = 0.95 if lab == 0 else 0.25
edge = "black" if lab == 0 else None
lw = 0.4 if lab == 0 else 0
plt.scatter(X_pca[mask, 0], X_pca[mask, 1],
c=colors.get(lab, "gray"), s=size, alpha=alpha,
edgecolors=edge, linewidth=lw, label=f"label={lab}")
plt.title('PCA – Look for the "MIDDLE ZERO" hint in label=0')
plt.xlabel("PC1"); plt.ylabel("PC2")
plt.legend(); plt.grid(True, alpha=0.3)
plt.tight_layout()
plt.savefig("pca_middle_zero.png", dpi=220)
plt.show()

e where label == 0”)label == 0.e (this is the “MIDDLE ZERO” instruction).0 and 1 form bits in order.