A hydrophobic-polar chain on a 3D lattice, sampled by Metropolis Monte Carlo. Educational toy model, not a real protein.
Hint: the number grows like μ^n with μ ≈ 4.68 on the cubic lattice.
Runs headless: 6 independent chains per temperature, up to 200,000 steps each, and reports the median steps to reach energy −16 or lower (chain A).
The science
HP model. Each residue is hydrophobic (H) or polar (P) and sits on a point of the simple cubic lattice; consecutive residues are neighbours and no site is used twice (self-avoiding walk). The energy is E = −ε · NHH, where NHH counts non-bonded H–H nearest-neighbour pairs. The hydrophobic effect (water prefers to hydrogen-bond with itself rather than organise around oily side chains) is the origin of this attraction; it is entropy-driven in the real solvent, here folded into a single energy ε. Real proteins have 20 amino-acid types, side-chain packing, hydrogen bonds, helices and sheets, none of which appear here (Lau and Dill 1989).
Metropolis Monte Carlo. A trial move to a new conformation is accepted with probability min(1, exp(−ΔE/kT)). The proposal (end move, corner flip, pivot of head or tail by a random cubic symmetry) is symmetric, so detailed balance holds and long-run visiting frequency is the Boltzmann distribution P ∝ exp(−E/kT). A Monte Carlo step is not a physical time; it only orders the search.
Levinthal's paradox. The number of self-avoiding walks grows as cn ≈ A μn nγ−1 with μ ≈ 4.684 and γ ≈ 1.157 on the cubic lattice (A ≈ 1.2 here, approximate). Even at 1013 conformations per second (a generous Levinthal-style rate, my assumption), exhaustive search for 100 residues takes astronomically long, yet real proteins fold in milliseconds to seconds because the energy landscape is funnel-shaped: native-like contacts lower the energy, so the search is biased downhill.
The funnel. The funnel is schematic: its radius is the chain's radius of gyration Rg = √(⟨|ri − rcm|²⟩) normalised between the best-folded and fully extended chain, and its height follows h ∝ ρ1.6. The scatter chart shows the real energy and Rg of the sampled states.
Simplifications and limits. The lowest energy per sequence ("best known") was found by repeated simulated annealing, not proven optimal, except the all-H 27-mer where −28 equals the maximal contact count of a 3×3×3 cube. Chain A reaches −18 in the runs used here. Conformations are on a lattice, so geometry is crude. Assets built with Blender; scene by Three.js.