Below is an interactive scale of infinities. Pick a set and the demo tries to pair it one-to-one with the counting numbers. If the pairing works, the set is the same size as ℵ₀. If it fails — as it does for the reals, by Cantor's diagonal trick — the set is strictly bigger.
<p class="hint">Pick a set. The demo tries to <b>pair it one-to-one with the counting
numbers</b> 1, 2, 3, … If every element gets a partner, the set is the same size as
<b>ℵ₀</b> (countable). For the reals the pairing always fails — Cantor’s
diagonal builds a number that was left out, proving the reals are <b>strictly bigger</b>.</p>
<div class="sets">
<button data-set="evens" type="button">Even numbers</button>
<button data-set="rationals" type="button">Fractions (rationals)</button>
<button data-set="reals" type="button">Real numbers</button>
</div>
<div id="pairing" class="pairing"></div>
<div class="status" id="status">Choose a set to test its size.</div>
<hr/>
<p class="hint">This is the scale of infinities. <b>ℵ₀</b> (countable) sits at the
bottom; <b>2^ℵ₀</b> (the reals) at the top. Drag to the <b>spot in between</b> —
the Continuum Hypothesis asks if anything can ever live there.</p>
<div class="scale">
<div class="track"><div id="fill" class="fill"></div><div id="knob" class="knob"></div></div>
<input id="slider" type="range" min="0" max="100" value="0" />
<div class="labels"><span>2^ℵ₀ (reals)</span><span>ℵ₀ (countable)</span></div>
</div>
<div class="verdict" id="verdict">At ℵ₀: the smallest infinity — integers, fractions, all countable.</div>
* { box-sizing: border-box; }
body { font-family: system-ui, sans-serif; color: #222; margin: 0; }
.hint { font-size: .9rem; color: #444; margin: 0 0 .7rem; line-height: 1.45; }
.sets { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .6rem; }
button { font: 600 14px system-ui, sans-serif; padding: .45rem .9rem; border: 1px solid #1d3557;
background: #fff; color: #1d3557; border-radius: 8px; cursor: pointer; }
button.active { background: #1d3557; color: #fff; }
.pairing { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: .4rem 0; min-height: 2.4em; }
.pair { background: #e8eef3; border: 1px solid #cdd9e3; border-radius: 7px; padding: .35rem .2rem;
text-align: center; font: 600 13px ui-monospace, monospace; color: #1d3557; }
.pair.miss { background: #fde2e4; border-color: #f5b5bb; color: #c92f3c; }
.status { font-size: 1rem; font-weight: 600; margin: .5rem 0; min-height: 1.4em; }
.status.ok { color: #0a7d33; }
.status.bad { color: #c92f3c; }
hr { border: none; border-top: 1px solid #e3e3e3; margin: 1rem 0; }
.scale { margin: .4rem 0; }
.track { position: relative; height: 10px; background: linear-gradient(90deg,#e63946,#f1c453,#2a9d8f);
border-radius: 6px; }
.fill { display: none; }
.knob { position: absolute; top: -5px; left: 0; width: 20px; height: 20px; background: #1d3557;
border: 3px solid #fff; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,.3); transform: translateX(-50%); }
#slider { width: 100%; margin-top: .5rem; }
.labels { display: flex; justify-content: space-between; font: 600 12px ui-monospace, monospace; color: #1d3557; }
.verdict { font-size: .95rem; font-weight: 600; margin-top: .6rem; min-height: 2.4em; line-height: 1.4; }
const fmt = (s, v) => s.replace(/%(\w+)%/g, (_, k) => String(v[k] ?? ''));
// Two facts drive this demo:
// (1) A set is "countable" (size aleph-null) iff its elements can be listed 1,2,3,...
// Evens and rationals CAN; the reals CANNOT (Cantor's diagonal argument).
// (2) The Continuum Hypothesis asks whether any size sits strictly between
// aleph-null and 2^aleph-null (the reals). Goedel (1940) + Cohen (1963)
const pairing = document.getElementById('pairing');
const status = document.getElementById('status');
function setStatus(t, cls){ status.textContent = t; status.className = 'status ' + cls; }
function cell(text, miss){ const d=document.createElement('div'); d.className='pair'+(miss?' miss':''); d.textContent=text; return d; }
// Enumerations proving countability. n = 1,2,3,... -> a unique element.
function evenAt(n){ return 2*n; } // 1->2, 2->4, 3->6 ...
// Rationals: Cantor's diagonal enumeration of positive p/q (deduped).
function rationalList(count){
const out=[], seen=new Set();
for(let s=2; out.length<count; s++){ // s = p+q, the anti-diagonal
for(let p=1; p<s; p++){ const q=s-p; const g=gcd(p,q);
const key=(p/g)+'/'+(q/g); if(!seen.has(key)){ seen.add(key); out.push(p+'/'+q); if(out.length>=count) break; } }
}
return out;
}
function gcd(a,b){ return b? gcd(b,a%b): a; }
function showCountable(label, getter){
pairing.innerHTML='';
for(let n=1; n<=10; n++){
const val = typeof getter === 'function' ? getter(n) : getter[n-1];
pairing.appendChild(cell(n + ' → ' + val, false));
}
setStatus(fmt('✓ Every counting number gets a partner — %label% is the same size as ℵ₀ (countable).', { label: label }), 'ok');
}
function showReals(){
// Cantor's diagonal: take ANY proposed list of reals in [0,1), flip the n-th
// digit of the n-th number. The result differs from every listed real -> the
// list is incomplete -> the reals are uncountable, strictly bigger than aleph-null.
pairing.innerHTML='';
const list=[]; for(let i=0;i<10;i++){ let d='0.'; for(let j=0;j<8;j++) d+=Math.floor(Math.random()*10); list.push(d); }
let diag='0.';
for(let i=0;i<8;i++){ const digit=parseInt(list[i][i+2],10); diag += ((digit+1)%10); }
for(let i=0;i<10;i++){ pairing.appendChild(cell((i+1)+' → '+list[i], false)); }
setStatus(fmt('✗ The diagonal number %diag% differs from every entry — it was left off the list. The reals are UNCOUNTABLE, strictly bigger than ℵ₀.', { diag: diag }), 'bad');
}
document.querySelectorAll('.sets button').forEach(b=>{
b.addEventListener('click', ()=>{
document.querySelectorAll('.sets button').forEach(x=>x.classList.remove('active'));
b.classList.add('active');
const s=b.dataset.set;
if(s==='evens') showCountable('the even numbers', evenAt);
else if(s==='rationals') showCountable('the fractions', rationalList(10));
else showReals();
});
});
// The infinity scale. 0 = aleph-null (bottom), 100 = 2^aleph-null (reals, top).
const slider=document.getElementById('slider');
const knob=document.getElementById('knob');
const verdict=document.getElementById('verdict');
function updateScale(){
const v=+slider.value; // 0..100, but the track shows reals on the left visually
knob.style.left=v+'%';
if(v<=8){
verdict.textContent='At ℵ₀: the smallest infinity — integers, fractions, all countable.';
verdict.style.color='#0a7d33';
} else if(v>=92){
verdict.textContent='At 2^ℵ₀: the continuum — the real numbers, provably bigger than ℵ₀.';
verdict.style.color='#c92f3c';
} else {
verdict.textContent='In between: this is where the Continuum Hypothesis lives. Gödel (1940) and Cohen (1963) proved standard math can NEITHER confirm nor deny a set of this size exists — it is independent of ZFC.';
verdict.style.color='#1d3557';
}
}
slider.addEventListener('input', updateScale);
updateScale();
<p class="hint">Pick a set. The demo tries to <b>pair it one-to-one with the counting
numbers</b> 1, 2, 3, … If every element gets a partner, the set is the same size as
<b>ℵ₀</b> (countable). For the reals the pairing always fails — Cantor’s
diagonal builds a number that was left out, proving the reals are <b>strictly bigger</b>.</p>
<div class="sets">
<button data-set="evens" type="button">Even numbers</button>
<button data-set="rationals" type="button">Fractions (rationals)</button>
<button data-set="reals" type="button">Real numbers</button>
</div>
<div id="pairing" class="pairing"></div>
<div class="status" id="status">Choose a set to test its size.</div>
<hr/>
<p class="hint">This is the scale of infinities. <b>ℵ₀</b> (countable) sits at the
bottom; <b>2^ℵ₀</b> (the reals) at the top. Drag to the <b>spot in between</b> —
the Continuum Hypothesis asks if anything can ever live there.</p>
<div class="scale">
<div class="track"><div id="fill" class="fill"></div><div id="knob" class="knob"></div></div>
<input id="slider" type="range" min="0" max="100" value="0" />
<div class="labels"><span>2^ℵ₀ (reals)</span><span>ℵ₀ (countable)</span></div>
</div>
<div class="verdict" id="verdict">At ℵ₀: the smallest infinity — integers, fractions, all countable.</div>
* { box-sizing: border-box; }
body { font-family: system-ui, sans-serif; color: #222; margin: 0; }
.hint { font-size: .9rem; color: #444; margin: 0 0 .7rem; line-height: 1.45; }
.sets { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .6rem; }
button { font: 600 14px system-ui, sans-serif; padding: .45rem .9rem; border: 1px solid #1d3557;
background: #fff; color: #1d3557; border-radius: 8px; cursor: pointer; }
button.active { background: #1d3557; color: #fff; }
.pairing { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: .4rem 0; min-height: 2.4em; }
.pair { background: #e8eef3; border: 1px solid #cdd9e3; border-radius: 7px; padding: .35rem .2rem;
text-align: center; font: 600 13px ui-monospace, monospace; color: #1d3557; }
.pair.miss { background: #fde2e4; border-color: #f5b5bb; color: #c92f3c; }
.status { font-size: 1rem; font-weight: 600; margin: .5rem 0; min-height: 1.4em; }
.status.ok { color: #0a7d33; }
.status.bad { color: #c92f3c; }
hr { border: none; border-top: 1px solid #e3e3e3; margin: 1rem 0; }
.scale { margin: .4rem 0; }
.track { position: relative; height: 10px; background: linear-gradient(90deg,#e63946,#f1c453,#2a9d8f);
border-radius: 6px; }
.fill { display: none; }
.knob { position: absolute; top: -5px; left: 0; width: 20px; height: 20px; background: #1d3557;
border: 3px solid #fff; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,.3); transform: translateX(-50%); }
#slider { width: 100%; margin-top: .5rem; }
.labels { display: flex; justify-content: space-between; font: 600 12px ui-monospace, monospace; color: #1d3557; }
.verdict { font-size: .95rem; font-weight: 600; margin-top: .6rem; min-height: 2.4em; line-height: 1.4; }
const fmt = (s, v) => s.replace(/%(\w+)%/g, (_, k) => String(v[k] ?? ''));
// Two facts drive this demo:
// (1) A set is "countable" (size aleph-null) iff its elements can be listed 1,2,3,...
// Evens and rationals CAN; the reals CANNOT (Cantor's diagonal argument).
// (2) The Continuum Hypothesis asks whether any size sits strictly between
// aleph-null and 2^aleph-null (the reals). Goedel (1940) + Cohen (1963)
const pairing = document.getElementById('pairing');
const status = document.getElementById('status');
function setStatus(t, cls){ status.textContent = t; status.className = 'status ' + cls; }
function cell(text, miss){ const d=document.createElement('div'); d.className='pair'+(miss?' miss':''); d.textContent=text; return d; }
// Enumerations proving countability. n = 1,2,3,... -> a unique element.
function evenAt(n){ return 2*n; } // 1->2, 2->4, 3->6 ...
// Rationals: Cantor's diagonal enumeration of positive p/q (deduped).
function rationalList(count){
const out=[], seen=new Set();
for(let s=2; out.length<count; s++){ // s = p+q, the anti-diagonal
for(let p=1; p<s; p++){ const q=s-p; const g=gcd(p,q);
const key=(p/g)+'/'+(q/g); if(!seen.has(key)){ seen.add(key); out.push(p+'/'+q); if(out.length>=count) break; } }
}
return out;
}
function gcd(a,b){ return b? gcd(b,a%b): a; }
function showCountable(label, getter){
pairing.innerHTML='';
for(let n=1; n<=10; n++){
const val = typeof getter === 'function' ? getter(n) : getter[n-1];
pairing.appendChild(cell(n + ' → ' + val, false));
}
setStatus(fmt('✓ Every counting number gets a partner — %label% is the same size as ℵ₀ (countable).', { label: label }), 'ok');
}
function showReals(){
// Cantor's diagonal: take ANY proposed list of reals in [0,1), flip the n-th
// digit of the n-th number. The result differs from every listed real -> the
// list is incomplete -> the reals are uncountable, strictly bigger than aleph-null.
pairing.innerHTML='';
const list=[]; for(let i=0;i<10;i++){ let d='0.'; for(let j=0;j<8;j++) d+=Math.floor(Math.random()*10); list.push(d); }
let diag='0.';
for(let i=0;i<8;i++){ const digit=parseInt(list[i][i+2],10); diag += ((digit+1)%10); }
for(let i=0;i<10;i++){ pairing.appendChild(cell((i+1)+' → '+list[i], false)); }
setStatus(fmt('✗ The diagonal number %diag% differs from every entry — it was left off the list. The reals are UNCOUNTABLE, strictly bigger than ℵ₀.', { diag: diag }), 'bad');
}
document.querySelectorAll('.sets button').forEach(b=>{
b.addEventListener('click', ()=>{
document.querySelectorAll('.sets button').forEach(x=>x.classList.remove('active'));
b.classList.add('active');
const s=b.dataset.set;
if(s==='evens') showCountable('the even numbers', evenAt);
else if(s==='rationals') showCountable('the fractions', rationalList(10));
else showReals();
});
});
// The infinity scale. 0 = aleph-null (bottom), 100 = 2^aleph-null (reals, top).
const slider=document.getElementById('slider');
const knob=document.getElementById('knob');
const verdict=document.getElementById('verdict');
function updateScale(){
const v=+slider.value; // 0..100, but the track shows reals on the left visually
knob.style.left=v+'%';
if(v<=8){
verdict.textContent='At ℵ₀: the smallest infinity — integers, fractions, all countable.';
verdict.style.color='#0a7d33';
} else if(v>=92){
verdict.textContent='At 2^ℵ₀: the continuum — the real numbers, provably bigger than ℵ₀.';
verdict.style.color='#c92f3c';
} else {
verdict.textContent='In between: this is where the Continuum Hypothesis lives. Gödel (1940) and Cohen (1963) proved standard math can NEITHER confirm nor deny a set of this size exists — it is independent of ZFC.';
verdict.style.color='#1d3557';
}
}
slider.addEventListener('input', updateScale);
updateScale();
Notice the two solid landmarks: ℵ₀ at the bottom (integers, fractions, rationals — all countable) and 2^ℵ₀ at the top (the reals — uncountable). The Continuum Hypothesis asks whether the marked spot in between can ever contain a real set. Drag the slider there: mathematics cannot tell you if anything lives at that point.
Comments
Loading comments...