import matplotlib.pyplot as plt
n = list(range(1, 11))
rows = [2**k for k in n]
fig, ax = plt.subplots(figsize=(10, 5))
ax.plot(n, rows, marker="o", linewidth=2.5, color="#2C7FB8")
for letters, count in zip(n, rows):
ax.annotate(
f"{count:,}",
(letters, count),
xytext=(0, 8),
textcoords="offset points",
ha="center",
fontsize=12,
)
ax.set_title(r"Truth-table size grows exponentially: $2^n$")
ax.set_xlabel("Number of propositional letters ($n$)")
ax.set_ylabel("Number of rows ($2^n$)")
ax.set_xticks(n)
ax.grid(True, axis="y", alpha=0.3)
ax.spines[["top", "right"]].set_visible(False)
fig.tight_layout()
plt.show()