Unit 1: Star Life Cycles
Does the exoplanet have a star like our Sun? What is our Sun like compared to other stars?
Engage: What Happens to Stars Over Time?
💥 A Star Exploded — And the Whole World Noticed
In 1054 CE, a star exploded so violently that it was visible in broad daylight for 23 days. Historical records from China, Japan, the Middle East, and the Americas all describe it. Today, the remnant is the Crab Nebula.
If stars can explode, that’s bad news for any planet orbiting them. So the big question becomes:
- 🤔 What made that star explode while our Sun has been stable for 4.6 billion years?
- 🤔 How do we know which stars are stable enough to support life?
- 🤔 Does the exoplanet in our performance task orbit a stable star?
Code
buildQuiz = function(id, title, questions) {
const outer = html`<div id="${id}" style="margin:18px 0 24px 0;text-align:center;">
<button style="
display:inline-flex;align-items:center;gap:7px;
background:linear-gradient(135deg,#667eea 0%,#764ba2 100%);
color:#fff;border:none;padding:9px 22px;border-radius:50px;
font-size:.95em;font-weight:700;cursor:pointer;
box-shadow:0 3px 12px rgba(102,126,234,.45);
transition:transform .15s,box-shadow .15s;"
onmouseover="this.style.transform='scale(1.04)';this.style.boxShadow='0 5px 18px rgba(102,126,234,.55)'"
onmouseout="this.style.transform='scale(1)';this.style.boxShadow='0 3px 12px rgba(102,126,234,.45)'"
>
<span style="font-size:1.1em;">📝</span> ${title}
<span class="chevron" style="transition:transform .3s;">▼</span>
</button>
<div class="quiz-body" style="
max-height:0;opacity:0;overflow:hidden;
transition:max-height .5s cubic-bezier(.4,0,.2,1),opacity .4s ease,margin-top .3s ease;
margin-top:0;text-align:left;">
<button class="close-btn" style="
display:block;margin:0 auto 10px auto;
background:rgba(102,126,234,.12);color:#667eea;border:none;
padding:5px 18px;border-radius:50px;font-size:.85em;
font-weight:600;cursor:pointer;">Hide Quiz</button>
<p style="text-align:center;color:#718096;font-style:italic;font-size:.9em;margin-bottom:12px;">
Select an answer for each question.</p>
</div>
</div>`;
const toggle = outer.querySelector("button");
const chevron = toggle.querySelector(".chevron");
const body = outer.querySelector(".quiz-body");
const closeBtn = body.querySelector(".close-btn");
function expand(){ body.style.maxHeight="2000px";body.style.opacity="1";body.style.marginTop="14px";chevron.style.transform="rotate(180deg)"; }
function collapse(){ body.style.maxHeight="0";body.style.opacity="0";body.style.marginTop="0";chevron.style.transform="rotate(0)"; }
toggle.onclick = () => body.style.maxHeight === "0px" || body.style.maxHeight === "" ? expand() : collapse();
closeBtn.onclick = collapse;
questions.forEach((qq, qi) => {
const card = document.createElement("div");
card.style.cssText = "background:#fff;color:#1e1b4b;border-radius:12px;padding:16px 20px;margin-bottom:14px;box-shadow:0 2px 8px rgba(0,0,0,.08);";
card.innerHTML = `<p style="font-weight:700;margin:0 0 10px;">${qi+1}. ${qq.q}</p>`;
qq.options.forEach((opt, oi) => {
const btn = document.createElement("button");
btn.textContent = opt;
btn.style.cssText = "display:block;width:100%;min-height:44px;text-align:left;padding:10px 14px;margin:6px 0;border:2px solid #e2e8f0;border-radius:8px;background:#fff;color:#1e1b4b;cursor:pointer;font-size:.95em;transition:border-color .2s,background .2s;";
btn.onmouseover = () => { if(!card.dataset.answered){ btn.style.borderColor="#667eea";btn.style.background="#f0f0ff"; }};
btn.onmouseout = () => { if(!card.dataset.answered){ btn.style.borderColor="#e2e8f0";btn.style.background="#fff"; }};
btn.onclick = () => {
if(card.dataset.answered) return;
card.dataset.answered = "true";
card.querySelectorAll("button").forEach(b => { b.style.cursor="default"; b.onmouseover=null; b.onmouseout=null; });
if(oi === qq.correct){
btn.style.borderColor="#48bb78";btn.style.background="#f0fff4";
fb.innerHTML = "✅ Correct! " + qq.explanation;
fb.style.color="#276749";fb.style.background="#f0fff4";
} else {
btn.style.borderColor="#fc8181";btn.style.background="#fff5f5";
card.querySelectorAll("button")[qq.correct].style.borderColor="#48bb78";
card.querySelectorAll("button")[qq.correct].style.background="#f0fff4";
fb.innerHTML = "❌ " + qq.explanation;
fb.style.color="#9b2c2c";fb.style.background="#fff5f5";
}
fb.style.padding="10px 14px";fb.style.marginTop="8px";
};
card.appendChild(btn);
});
const fb = document.createElement("div");
fb.style.cssText = "border-radius:8px;font-size:.9em;transition:all .3s;";
card.appendChild(fb);
body.appendChild(card);
});
return outer;
}Code
starLifespans = [
{type: "O-type\n(60 M☉)", mass: 60, lifespan: 0.003, temp: 40000, luminosity: 800000, color: "#6ca0dc", fate: "Supernova → Black hole"},
{type: "B-type\n(10 M☉)", mass: 10, lifespan: 0.02, temp: 20000, luminosity: 10000, color: "#a0c4ff", fate: "Supernova → Neutron star"},
{type: "A-type\n(2 M☉)", mass: 2, lifespan: 1.0, temp: 8500, luminosity: 20, color: "#ffffff", fate: "Planetary nebula"},
{type: "G-type\n(1 M☉) ← SUN", mass: 1, lifespan: 10, temp: 5800, luminosity: 1, color: "#ffdd57", fate: "Red giant → White dwarf"},
{type: "K-type\n(0.7 M☉)", mass: 0.7, lifespan: 17, temp: 4500, luminosity: 0.3, color: "#ffa94d", fate: "Red giant → White dwarf"},
{type: "M-type\n(0.3 M☉)", mass: 0.3, lifespan: 70, temp: 3200, luminosity: 0.01, color: "#ff6b6b", fate: "Never leaves main sequence"}
]
Plot.plot({
title: "Star Lifespan vs. Mass — Bigger Stars Die MUCH Faster",
subtitle: "Our Sun (G-type, 1 solar mass) has a 10-billion-year lifespan",
width: width,
height: 380,
marginLeft: 110,
x: {label: "Lifespan (billion years)", type: "log", grid: true},
y: {label: null},
marks: [
Plot.barX(starLifespans, {
y: "type",
x: "lifespan",
fill: "color",
sort: {y: "x"}
,
tip: true}),
Plot.text(starLifespans, {
y: "type",
x: "lifespan",
text: d => `${d.lifespan >= 1 ? d.lifespan + " Gyr" : (d.lifespan * 1000) + " Myr"} → ${d.fate}`,
dx: 5,
textAnchor: "start",
fontSize: 10,
fontWeight: "bold"
}),
Plot.ruleX([4.6], {stroke: "#e74c3c", strokeWidth: 2, strokeDasharray: "5,5"}),
Plot.text([{y: "A-type\n(2 M☉)", x: 4.6}], {
y: "y", x: "x", text: d => "← Age of life on Earth",
dx: 5, dy: -12, fontSize: 10, fill: "#e74c3c", fontWeight: "bold"
})
]
})Code
buildQuiz("star-lifespan-quiz", "⭐ Check Your Understanding — Star Lifespans", [
{
q: "What is the relationship between a star's mass and its lifespan?",
options: ["Higher mass = longer lifespan", "Higher mass = shorter lifespan (they burn fuel much faster)", "Mass has no effect on lifespan", "Only medium-mass stars have predictable lifespans"],
correct: 1,
explanation: "More massive stars have stronger gravity compressing their cores, driving fusion at a much faster rate. An O-type star (60 M☉) burns through its fuel in just 3 million years, while a low-mass M-type (0.3 M☉) lasts 70 billion years."
},
{
q: "The red dashed line marks 4.6 billion years (the age of life on Earth). Which star types have lifespans shorter than this?",
options: ["Only O-type stars", "O-type and B-type stars", "O-type, B-type, and A-type stars", "All star types except G-type"],
correct: 2,
explanation: "O-type (3 Myr), B-type (20 Myr), and A-type (1 Gyr) stars all burn out well before 4.6 billion years. Any planet orbiting these stars would not have enough time for complex life to evolve."
},
{
q: "An M-type star lives 70 billion years — far longer than needed for life. Why might it still be problematic for habitability?",
options: ["M-type stars are too hot for nearby planets", "M-type stars have very low luminosity, so the habitable zone is extremely close to the star", "M-type stars cannot fuse hydrogen", "M-type stars always explode as supernovae"],
correct: 1,
explanation: "M-type stars have luminosities as low as 0.01× the Sun's. The habitable zone would be so close that the planet likely becomes tidally locked (one side always facing the star), creating extreme temperature differences."
}
])Explore 1: Patterns of Star Stability
🔬 The Hertzsprung-Russell Diagram
The H-R diagram is one of the most important tools in astronomy. It plots stars by their temperature (x-axis) and luminosity (y-axis), revealing patterns in how stars live and die.
Code
hrStars = [
// Main sequence
{name: "Hot blue giant", temp: 30000, lum: 100000, stage: "Main Sequence", r: 5},
{name: "B-type", temp: 20000, lum: 10000, stage: "Main Sequence", r: 4},
{name: "Sirius A", temp: 9900, lum: 25, stage: "Main Sequence", r: 4},
{name: "Sun", temp: 5800, lum: 1, stage: "Main Sequence", r: 6},
{name: "K-dwarf", temp: 4500, lum: 0.3, stage: "Main Sequence", r: 3},
{name: "Proxima Centauri", temp: 3000, lum: 0.0017, stage: "Main Sequence", r: 4},
// Red giants
{name: "Betelgeuse", temp: 3500, lum: 100000, stage: "Red Giant", r: 7},
{name: "Aldebaran", temp: 3900, lum: 500, stage: "Red Giant", r: 5},
{name: "Arcturus", temp: 4300, lum: 170, stage: "Red Giant", r: 5},
// White dwarfs
{name: "Sirius B", temp: 25000, lum: 0.03, stage: "White Dwarf", r: 3},
{name: "Procyon B", temp: 7700, lum: 0.0005, stage: "White Dwarf", r: 3},
// Supergiants
{name: "Rigel", temp: 12000, lum: 120000, stage: "Supergiant", r: 6},
{name: "Deneb", temp: 8500, lum: 200000, stage: "Supergiant", r: 6}
]
{
const hrStageColors = {
domain: ["Main Sequence", "Red Giant", "White Dwarf", "Supergiant"],
range: ["#3498db", "#e74c3c", "#b0bec5", "#f39c12"]
};
const hrWrap = d3.create("div");
hrWrap.style("max-width", "100%");
hrWrap.append(() => Plot.plot({
title: "Hertzsprung-Russell Diagram",
subtitle: "Temperature decreases to the right (astronomers are weird like that)",
width: width,
height: 420,
marginLeft: 48,
marginRight: 8,
marginBottom: 40,
x: {label: "Surface Temperature (K)", reverse: true, type: "log"},
y: {label: "Luminosity (× Sun)", type: "log", grid: true},
marks: [
Plot.dot(hrStars, {
x: "temp",
y: "lum",
fill: "stage",
r: "r",
stroke: "#333",
strokeWidth: 0.5,
title: d => `${d.name}\nTemp: ${d.temp}K\nLuminosity: ${d.lum}× Sun\nStage: ${d.stage}`,
tip: true
}),
Plot.text(hrStars.filter(d => ["Sun", "Sirius B", "Rigel"].includes(d.name)), {
x: "temp",
y: "lum",
text: "name",
textAnchor: "start",
dx: 12,
dy: 8,
fontSize: 11,
fontWeight: "bold"
}),
Plot.text(hrStars.filter(d => ["Betelgeuse", "Proxima Centauri"].includes(d.name)), {
x: "temp",
y: "lum",
text: "name",
textAnchor: "end",
dx: -10,
dy: 8,
fontSize: 11,
fontWeight: "bold"
}),
Plot.ruleY([1], {stroke: "#f39c12", strokeDasharray: "3,3", strokeOpacity: 0.5})
]
}));
hrWrap.append("div")
.style("display", "flex")
.style("flex-wrap", "wrap")
.style("gap", "6px 16px")
.style("justify-content", "center")
.style("margin-top", "10px")
.style("font-size", "0.85em")
.html(hrStageColors.domain.map((s, i) =>
`<span style="display:inline-flex;align-items:center;gap:6px;">` +
`<span style="width:12px;height:12px;border-radius:50%;background:${hrStageColors.range[i]};border:1px solid #333;flex:0 0 auto;"></span>` +
`${s}</span>`).join(""));
return hrWrap.node();
}🔭 Real Star Data: Hipparcos H-R Diagram
The diagram above uses a handful of example stars. Below is the same concept built from real data — over 800 nearby stars measured by the Hipparcos space telescope. Each point is an actual star plotted by its color (B−V index, which maps to surface temperature) and absolute magnitude (luminosity). Hover over any star to see its temperature, luminosity, and magnitude.
Code
// Fetch the real Hipparcos star catalog directly — avoids Observable FileAttachment issues
hrRawData = d3.csv(
"https://static.observableusercontent.com/files/a01b08636a1314e9dc329d141684564156cb49190d762542f3b8d09a20f7c3275fe0be93d2ed6f9056af7b27708ed91037b729cf12263e63c0eb98abd43702fc",
d3.autoType
)Code
// Enrich each star with temperature, luminosity, and pre-computed star color
hrStarData = {
function bv2rgb(bv) {
bv = Math.max(-0.4, Math.min(2, bv));
let t;
return `#${[
bv < 0 ? (t=(bv+0.4)/0.4, 0.61+0.11*t+0.1*t*t) : bv < 0.4 ? (t=bv/0.4, 0.83+0.17*t) : 1,
bv < 0 ? (t=(bv+0.4)/0.4, 0.70+0.07*t+0.1*t*t) : bv < 0.4 ? (t=bv/0.4, 0.87+0.11*t) : bv < 1.6 ? (t=(bv-0.4)/1.2, 0.98-0.16*t) : (t=(bv-1.6)/0.4, 0.82-0.5*t*t),
bv < 0.4 ? 1 : bv < 1.5 ? (t=(bv-0.4)/1.1, 1-0.47*t+0.1*t*t) : bv < 1.94 ? (t=(bv-1.5)/0.44, 0.63-0.6*t*t) : 0
].map(t => Math.round(t*255).toString(16).padStart(2,"0")).join("")}`;
}
return hrRawData.map(d => ({
bv: +d.color.toFixed(3),
magnitude: +d.absolute_magnitude.toFixed(2),
temperature: Math.round(4600 * (1/(0.92*d.color+1.7) + 1/(0.92*d.color+0.62))),
luminosity: +(10**((4.83-d.absolute_magnitude)/2.5)).toFixed(2),
starColor: bv2rgb(d.color)
}));
}Code
Plot.plot({
title: "Hertzsprung-Russell Diagram — Real Stars from the Hipparcos Catalog",
subtitle: "Hover any star to see its temperature, luminosity, and magnitude",
width: width,
height: 600,
style: { background: "#111", color: "#eee", fontFamily: "sans-serif" },
x: {
label: "B-V Color Index (blue/hot ←——→ red/cool)",
domain: [-0.39, 2.19],
grid: true
},
y: {
label: "Absolute Magnitude (bright ↑ ↓ dim)",
domain: [-7, 19],
reverse: true,
grid: true
},
marks: [
Plot.dot(hrStarData, {
x: "bv",
y: "magnitude",
fill: d => d.starColor,
r: 2.5,
opacity: 0.85,
channels: {
"B-V": "bv",
"Temp (K)": "temperature",
"Luminosity (L☉)": "luminosity",
"Abs. Magnitude": "magnitude"
},
tip: true
})
]
})Code
buildQuiz("hr-diagram-quiz", "📊 Check Your Understanding — H-R Diagram", [
{
q: "The dense diagonal band running from upper-left to lower-right is the Main Sequence. Why are there far more cool, dim stars (lower-right) than hot, bright ones (upper-left)?",
options: ["Cool stars are closer to Earth so we detect more of them", "Low-mass stars are far more common in the universe AND they live much longer, so more are still shining", "Hot stars are hidden behind dust clouds", "The diagram only sampled nearby stars, which happen to be cool"],
correct: 1,
explanation: "Low-mass stars are both more commonly formed and far longer-lived. A 0.3 M☉ star lives 70 billion years while a 60 M☉ star lasts only 3 million years. At any given time, many more low-mass stars are still on the main sequence."
},
{
q: "The cluster in the upper-right of the H-R diagram (high luminosity, low temperature) represents which evolutionary stage?",
options: ["Young protostars still forming", "Main sequence stars in their prime", "Red Giants — old stars that exhausted core hydrogen and expanded", "White dwarfs cooling down"],
correct: 2,
explanation: "Stars in the upper-right are Red Giants. When a main-sequence star exhausts its core hydrogen, the core contracts while the outer layers expand enormously, making the star very luminous but with a cool (red) surface."
},
{
q: "Our Sun (B-V ≈ 0.65, magnitude ≈ +4.8) sits in the middle of the Main Sequence. What does this position tell us about its suitability for supporting life?",
options: ["It's too dim to support life on nearby planets", "It's a moderately hot, moderately luminous, stable star with a ~10 billion year lifespan — ideal for life", "It's about to leave the main sequence and become a Red Giant", "Its position means it will eventually explode"],
correct: 1,
explanation: "The Sun's position in the middle main sequence means it has moderate temperature (~5,800 K), moderate luminosity (1 L☉), and a long stable lifespan (~10 Gyr). This 'Goldilocks' position gives planets billions of years of steady energy."
}
])💡 What the H-R Diagram Tells Us
- Main Sequence (diagonal band): Stars spending most of their lives here, fusing hydrogen stably
- Red Giants (upper right): Stars that ran out of core hydrogen and expanded enormously
- White Dwarfs (lower left): Dead stellar cores, slowly cooling
- Supergiants (top): Massive, luminous stars nearing explosive deaths
Our Sun sits comfortably in the middle of the Main Sequence — not too hot, not too cool, with a lifespan of ~10 billion years. This is the “Goldilocks zone” for stars supporting life.
Explain: Why Are Some Stars Stable and Others Explode?
🧠 The Battle: Gravity vs. Fusion Pressure
A star is a balancing act between two forces:
- Gravity pulls everything inward (wants to crush the star)
- Fusion pressure pushes outward (the energy from fusion creates radiation and heat)
As long as these forces balance, the star is stable. When the fuel runs out, gravity wins.
Code
viewof starMass = {
const W = 360, H = 250;
const ml = 48, mr = 14, mt = 34, mb = 48;
const plotW = W - ml - mr, plotH = H - mt - mb;
const mMin = 0.3, mMax = 30;
const tMin = 5800 * Math.sqrt(mMin), tMax = 5800 * Math.sqrt(mMax);
const xScale = t => ml + (Math.log10(tMax) - Math.log10(t)) / (Math.log10(tMax) - Math.log10(tMin)) * plotW;
const tFromX = x => Math.pow(10, Math.log10(tMax) - (x - ml) / plotW * (Math.log10(tMax) - Math.log10(tMin)));
const massFromX = x => Math.min(mMax, Math.max(mMin, Math.pow(tFromX(x) / 5800, 2)));
const lMin = Math.pow(mMin, 3.5), lMax = Math.pow(mMax, 3.5);
const yScale = l => mt + (Math.log10(lMax) - Math.log10(l)) / (Math.log10(lMax) - Math.log10(lMin)) * plotH;
const starColor = t => t > 20000 ? "#6ca0dc" : t > 10000 ? "#a0c4ff" : t > 7000 ? "#ffffff" : t > 5000 ? "#ffdd57" : t > 4000 ? "#ffa94d" : "#ff6b6b";
const el = document.createElement("div");
el.style.cssText = "max-width:520px;margin:auto;";
const svg = d3.create("svg").attr("viewBox", `0 0 ${W} ${H}`)
.style("width", "100%").style("height", "auto").style("display", "block")
.style("touch-action", "none").style("cursor", "grab");
svg.append("rect").attr("width", W).attr("height", H).attr("fill", "#0a0a2e").attr("rx", 12);
svg.append("text").attr("x", W/2).attr("y", 20).attr("text-anchor", "middle")
.attr("fill", "white").attr("font-size", 13).attr("font-weight", "bold")
.text("Drag the star along the main sequence");
svg.append("text").attr("x", ml + plotW/2).attr("y", H - 2).attr("text-anchor", "middle")
.attr("fill", "#9aa7bd").attr("font-size", 9).text("← hotter (high-mass) · cooler (low-mass) →");
svg.append("text").attr("x", 14).attr("y", mt + plotH/2).attr("text-anchor", "middle")
.attr("transform", `rotate(-90 14 ${mt + plotH/2})`).attr("fill", "#9aa7bd").attr("font-size", 9).text("Luminosity →");
const curve = d3.range(mMin, mMax + 0.001, 0.05);
svg.append("path").datum(curve)
.attr("d", d3.line().x(d => xScale(5800 * Math.sqrt(d))).y(d => yScale(Math.pow(d, 3.5)))(curve))
.attr("fill", "none").attr("stroke", "#f39c12").attr("stroke-width", 2.5);
const dot = svg.append("circle").attr("r", 9).attr("fill", "#4ade80").attr("stroke", "#fff").attr("stroke-width", 1.5);
const readout = svg.append("text").attr("x", W/2).attr("y", H - 20).attr("text-anchor", "middle")
.attr("fill", "#ffdd57").attr("font-size", 13).attr("font-weight", "bold");
function render(m) {
const t = 5800 * Math.sqrt(m), l = Math.pow(m, 3.5);
dot.attr("cx", xScale(t)).attr("cy", yScale(l)).attr("fill", starColor(t));
readout.text(`${m.toFixed(1)} M☉ · ${Math.round(t).toLocaleString()} K · ${l >= 1 ? l.toFixed(0) + "×" : l.toFixed(2) + "×"} Sun`);
el.value = m;
}
function setFromPointer(clientX) {
const rect = svg.node().getBoundingClientRect();
const px = (clientX - rect.left) / rect.width * W;
render(massFromX(Math.min(ml + plotW, Math.max(ml, px))));
el.dispatchEvent(new Event("input"));
}
render(1.0);
let dragging = false;
svg.node().addEventListener("pointerdown", e => {
dragging = true;
try { svg.node().setPointerCapture(e.pointerId); } catch {}
setFromPointer(e.clientX);
});
svg.node().addEventListener("pointermove", e => { if (dragging) setFromPointer(e.clientX); });
const end = () => { dragging = false; };
svg.node().addEventListener("pointerup", end);
svg.node().addEventListener("pointercancel", end);
el.appendChild(svg.node());
return el;
}Code
{
const mass = starMass;
const temp = Math.round(5800 * Math.pow(mass, 0.5));
const lum = Math.pow(mass, 3.5);
const lifespan = 10 / Math.pow(mass, 2.5);
const fate = mass < 0.5 ? "Slowly fades (never becomes red giant)" :
mass < 8 ? "Red Giant → White Dwarf" :
mass < 25 ? "Supergiant → Supernova → Neutron Star" :
"Supergiant → Supernova → BLACK HOLE";
const fateColor = mass < 8 ? "#f39c12" : mass < 25 ? "#e74c3c" : "#9b59b6";
const stable = lifespan > 4.6 ? "✅ Long enough for complex life" : "❌ Too short for complex life";
const stableColor = lifespan > 4.6 ? "#2ecc71" : "#e74c3c";
const starColor = temp > 20000 ? "#6ca0dc" : temp > 10000 ? "#a0c4ff" : temp > 7000 ? "#ffffff" : temp > 5000 ? "#ffdd57" : temp > 4000 ? "#ffa94d" : "#ff6b6b";
const svg = d3.create("svg")
.attr("viewBox", "0 0 360 240")
.style("width", "100%").style("height", "auto")
.style("max-width", "520px").style("display", "block").style("margin", "auto");
svg.append("rect").attr("width", 360).attr("height", 240).attr("fill", "#0a0a2e").attr("rx", 12);
svg.append("text").attr("x", 180).attr("y", 22).attr("text-anchor", "middle")
.attr("fill", "white").attr("font-size", 15).attr("font-weight", "bold")
.text(`Star: ${mass.toFixed(1)} Solar Masses`);
const r = Math.min(38, 8 + mass * 3);
svg.append("circle").attr("cx", 180).attr("cy", 62).attr("r", r)
.attr("fill", starColor).attr("opacity", 0.9);
const stats = [
{label: "Surface Temperature:", value: `${temp.toLocaleString()} K`, color: "white"},
{label: "Luminosity:", value: `${+lum.toFixed(1)}× Sun`, color: "white"},
{label: "Lifespan:", value: `${lifespan.toFixed(2)} billion years`, color: "white"},
{label: "Stability for life:", value: stable, color: stableColor},
{label: "Fate:", value: fate, color: fateColor}
];
stats.forEach((s, i) => {
const y = 108 + i * 26;
svg.append("text").attr("x", 10).attr("y", y).attr("fill", "#9aa7bd").attr("font-size", 11).text(s.label);
svg.append("text").attr("x", 350).attr("y", y).attr("text-anchor", "end").attr("fill", s.color).attr("font-size", 12).attr("font-weight", "bold").text(s.value);
});
return svg.node();
}Code
buildQuiz("star-mass-quiz", "⚖️ Check Your Understanding — Star Mass & Fate", [
{
q: "Using the diagram above, at approximately what mass does a star's lifespan drop below 4.6 billion years?",
options: ["About 0.5 solar masses", "About 1.2 solar masses", "About 5 solar masses", "About 10 solar masses"],
correct: 1,
explanation: "At ~1.2 solar masses, the lifespan drops to roughly 4.6 billion years (the age of life on Earth). Stars more massive than this burn out too quickly for complex life to evolve."
},
{
q: "What happens to a star's temperature and luminosity as mass increases?",
options: ["Both decrease — massive stars are cooler and dimmer", "Temperature increases but luminosity decreases", "Both increase dramatically — massive stars are much hotter and brighter", "Neither changes; mass only affects lifespan"],
correct: 2,
explanation: "Luminosity scales as M^3.5 and temperature as M^0.5. A 10 M☉ star is ~3,000× more luminous and nearly twice as hot as the Sun. This extreme output is exactly why massive stars exhaust fuel so quickly."
},
{
q: "Stars above ~8 solar masses end as supernovae. Why is this catastrophic for any orbiting planets?",
options: ["The supernova creates a black hole that swallows the planets", "The explosion releases enough energy to vaporize nearby planets and sterilize the surrounding region", "The star shrinks so planets drift away into space", "Supernovae only affect the star itself, not its planets"],
correct: 1,
explanation: "A supernova releases ~10⁴⁴ joules of energy in seconds — briefly outshining the entire galaxy. This vaporizes inner planets, strips atmospheres from outer ones, and bathes the region in lethal radiation. No planet nearby survives intact."
}
])Elaborate: Nucleosynthesis — Stars Build the Elements
🔬 Stars Are Element Factories
Stars don’t just burn hydrogen — they build heavier elements through nucleosynthesis. The mass of a star determines which elements it can create.
Code
elements = [
{element: "H → He", minMass: 0.08, phase: "Main Sequence", color: "#3498db"},
{element: "He → C, O", minMass: 0.5, phase: "Red Giant", color: "#f39c12"},
{element: "C → Ne, Na, Mg", minMass: 4, phase: "Late Giant", color: "#e67e22"},
{element: "Ne → O, Mg", minMass: 8, phase: "Supergiant", color: "#e74c3c"},
{element: "O → Si, S", minMass: 8, phase: "Supergiant", color: "#c0392b"},
{element: "Si → Fe (iron)", minMass: 10, phase: "Pre-supernova", color: "#8e44ad"},
{element: "Fe → heavier\n(Au, U, etc.)", minMass: 10, phase: "Supernova only!", color: "#2c3e50"}
]
Plot.plot({
title: "Nucleosynthesis: Which Stars Build Which Elements?",
subtitle: "Minimum star mass needed to create each element",
width: width,
height: 380,
marginLeft: 120,
x: {label: "Minimum Star Mass (solar masses)", grid: true},
y: {label: null},
marks: [
Plot.barX(elements, {
y: "element",
x: "minMass",
fill: "color",
sort: {y: null}
,
tip: true}),
Plot.text(elements, {
y: "element",
x: "minMass",
text: d => `${d.minMass} M☉ — ${d.phase}`,
dx: 5,
textAnchor: "start",
fontSize: 10,
fontWeight: "bold"
}),
Plot.ruleX([1], {stroke: "#ffdd57", strokeWidth: 2, strokeDasharray: "5,5"}),
Plot.text([{y: "He → C, O", x: 1}], {
y: "y", x: "x", text: d => "Our Sun →",
dx: -45, fontSize: 10, fill: "#ffdd57", fontWeight: "bold"
})
]
})Code
Code
{
const mass = fusionMass;
const shells = [
{label: "Fe core", minMass: 10, color: "#2c3e50"},
{label: "Si → Fe", minMass: 10, color: "#8e44ad"},
{label: "O → Si, S", minMass: 8, color: "#c0392b"},
{label: "Ne → O, Mg", minMass: 8, color: "#e74c3c"},
{label: "C → Ne, Na", minMass: 4, color: "#e67e22"},
{label: "He → C, O", minMass: 0.5, color: "#f39c12"},
{label: "H → He", minMass: 0.08, color: "#3498db"}
];
const active = shells.filter(s => mass >= s.minMass);
const supernova = mass >= 8;
const svg = d3.create("svg")
.attr("viewBox", "0 0 360 360")
.style("width", "100%").style("height", "auto")
.style("max-width", "520px").style("display", "block").style("margin", "auto");
svg.append("rect").attr("width", 360).attr("height", 360).attr("fill", "#0a0a2e").attr("rx", 12);
svg.append("text").attr("x", 180).attr("y", 24).attr("text-anchor", "middle")
.attr("fill", "white").attr("font-size", 15).attr("font-weight", "bold")
.text(`Fusion shells inside a ${mass.toFixed(1)} M☉ star`);
svg.append("text").attr("x", 180).attr("y", 40).attr("text-anchor", "middle")
.attr("fill", "#9aa7bd").attr("font-size", 10)
.text("Dim shells = not reached at this mass");
// Onion: concentric filled circles, innermost drawn last (on top)
const cx = 110, cy = 150;
active.slice().reverse().forEach((s, i) => {
const r = 24 + (active.length - 1 - i) * 15;
svg.append("circle").attr("cx", cx).attr("cy", cy).attr("r", r)
.attr("fill", s.color).attr("opacity", 0.85).attr("stroke", "#0a0a2e").attr("stroke-width", 1);
});
// Legend (all shells, active colored / inactive dimmed)
shells.forEach((s, i) => {
const isActive = mass >= s.minMass;
const y = 64 + i * 22;
svg.append("circle").attr("cx", 240).attr("cy", y - 4).attr("r", 6)
.attr("fill", s.color).attr("opacity", isActive ? 1 : 0.2);
svg.append("text").attr("x", 252).attr("y", y).attr("fill", isActive ? "#e2e8f0" : "#5b6675")
.attr("font-size", 11).attr("font-weight", isActive ? "bold" : "normal")
.text(s.label);
});
const status = supernova ? "Fuses down to an iron core → supernova!" :
mass >= 0.5 ? `Fuses down to ${active[0].label} → white dwarf` :
"Fuses only H → He — slowly fades";
svg.append("text").attr("x", 180).attr("y", 340).attr("text-anchor", "middle")
.attr("fill", supernova ? "#e74c3c" : "#2ecc71").attr("font-size", 12).attr("font-weight", "bold")
.text(status);
return svg.node();
}Code
buildQuiz("nucleosynthesis-quiz", "⚛️ Check Your Understanding — Nucleosynthesis", [
{
q: "Our Sun (1 solar mass) can fuse hydrogen into helium. What is the heaviest element it will ever produce?",
options: ["Iron (Fe)", "Carbon and Oxygen (C, O)", "Silicon (Si)", "Gold (Au)"],
correct: 1,
explanation: "Stars of ~1 solar mass can only fuse hydrogen into helium on the main sequence, then helium into carbon and oxygen during the Red Giant phase. Creating elements heavier than that requires more massive stars (4+ solar masses)."
},
{
q: "Elements heavier than iron (like gold and uranium) can only be created during which event?",
options: ["Normal main-sequence fusion", "Red Giant expansion", "Supernova explosions", "Planetary nebula formation"],
correct: 2,
explanation: "Fusing iron actually requires energy input rather than releasing it — it's energetically unfavorable. Only the extreme conditions of a supernova (temperatures exceeding billions of degrees) provide enough energy to forge elements heavier than iron."
}
])Chapter Summary
| Key Concept | Details |
|---|---|
| Mass–lifespan relationship | \(L_{life} \propto M^{-2.5}\) — more massive = shorter lifespan |
| H-R Diagram | Plots temperature vs. luminosity; Main Sequence = stable hydrogen fusion |
| Ideal star for life | G or K type, 0.5–1.5 M☉, main sequence, lifespan > 4 Gyr |
| Supernova threshold | Stars > 8 M☉ explode — destroying nearby planets |
| Nucleosynthesis | Stars build elements; heavier than iron requires supernovae |
| “Star stuff” | All elements in your body were forged inside ancient stars |
Myth or Fact?
⭐ Star Life Cycles: Myths vs. Facts
Decide whether each statement is a MYTH or a FACT!
End-of-Chapter Quiz
Study guide for the Unit 1 Mid-Unit Task. These practice questions use different stars and data than the task, but build the same skills: reading the H-R diagram, the life cycle model, and data tables. Pick an answer to see why.
Code
quizStimuli = {
const tbl = (headers, rows) => `<div style="overflow-x:auto;"><table style="border-collapse:collapse;width:100%;font-size:.82em;color:#1e1b4b;">
<thead><tr>${headers.map(h => `<th style="border:1px solid #c7d2fe;background:#eef2ff;padding:6px 8px;text-align:center;">${h}</th>`).join("")}</tr></thead>
<tbody>${rows.map(r => `<tr>${r.map((c, i) => `<td style="border:1px solid #c7d2fe;padding:6px 8px;text-align:center;${i === 0 ? "font-weight:700;background:#f8f9ff;" : ""}">${c}</td>`).join("")}</tr>`).join("")}</tbody>
</table></div>`;
const hr = (stars) => {
const W = 360, H = 250, L = 46, T = 14, pw = W - L - 12, ph = H - T - 40;
const x = t => L + (Math.log10(40000) - Math.log10(t)) / (Math.log10(40000) - Math.log10(2500)) * pw;
const y = l => T + (5 - Math.log10(l)) / 9 * ph;
const ell = (t, l, rx, ry, rot, label, color, ly) => {
const cx = x(t), cy = y(l);
return `<ellipse cx="${cx}" cy="${cy}" rx="${rx}" ry="${ry}" transform="rotate(${rot} ${cx} ${cy})" fill="${color}" fill-opacity=".15" stroke="${color}" stroke-width="1.2"/>
<text x="${cx}" y="${cy + ly}" font-size="9" text-anchor="middle" fill="${color}" font-weight="700">${label}</text>`;
};
const ms = [[30000,1e5],[20000,1e4],[10000,40],[5800,1],[4500,0.2],[3000,0.003]].map(([t, l]) => `${x(t)},${y(l)}`).join(" ");
const star = (t, l, name, dx, dy, anchor) => `<circle cx="${x(t)}" cy="${y(l)}" r="5" fill="#f59e0b" stroke="#1e1b4b" stroke-width="1.2"/>
<text x="${x(t) + dx}" y="${y(l) + dy}" font-size="9.5" font-weight="700" text-anchor="${anchor}" fill="#1e1b4b">${name}</text>`;
const xt = [40000, 20000, 10000, 5000, 2500].map(t => `<line x1="${x(t)}" x2="${x(t)}" y1="${T + ph}" y2="${T + ph + 4}" stroke="#334155"/><text x="${x(t)}" y="${T + ph + 14}" font-size="9" text-anchor="middle" fill="#334155">${t.toLocaleString()}</text>`).join("");
const yt = [1e4, 100, 1, 0.01, 0.0001].map(l => `<line x1="${L - 4}" x2="${L}" y1="${y(l)}" y2="${y(l)}" stroke="#334155"/><text x="${L - 7}" y="${y(l) + 3}" font-size="9" text-anchor="end" fill="#334155">${l}</text>`).join("");
return `<svg viewBox="0 0 ${W} ${H}" style="width:100%;height:auto;max-width:520px;display:block;margin:auto;" role="img" aria-label="Hertzsprung-Russell diagram showing the main sequence curve, giants, supergiants and white dwarfs, with the stars in the question plotted as labelled dots.">
<rect x="${L}" y="${T}" width="${pw}" height="${ph}" fill="#fff" stroke="#334155"/>
${ell(6000, 2e4, 80, 20, 0, "Supergiants", "#f97316", 3)}
${ell(4500, 200, 40, 17, 0, "Giants", "#ef4444", 29)}
${ell(14000, 0.015, 100, 22, 18, "White Dwarfs", "#64748b", 38)}
<polyline points="${ms}" fill="none" stroke="#3b82f6" stroke-width="2.5"/>
<text x="${x(16000)}" y="${y(900)}" font-size="9" fill="#3b82f6" font-weight="700">Main Sequence</text>
${stars.map(([t, l, n, dx, dy, a]) => star(t, l, n, dx, dy, a)).join("")}
${xt}${yt}
<text x="${L + pw / 2}" y="${H - 4}" font-size="10" text-anchor="middle" fill="#334155">Temperature (K)</text>
<text transform="translate(11 ${T + ph / 2}) rotate(-90)" font-size="10" text-anchor="middle" fill="#334155">Luminosity (Sun = 1)</text>
</svg>`;
};
const path = () => {
const chip = (t, bg) => `<span style="display:inline-block;background:${bg};color:#1e1b4b;border-radius:14px;padding:4px 10px;margin:2px;font-size:.82em;font-weight:600;">${t}</span>`;
const tag = (t, bg) => `<span style="display:inline-block;background:${bg};color:#fff;border-radius:10px;padding:1px 8px;margin:0 4px 0 0;font-size:.78em;font-weight:800;">${t}</span>`;
const arrow = `<span style="color:#667eea;font-weight:700;"> → </span>`;
return `<div style="line-height:2.2;color:#1e1b4b;">
<div style="font-size:.82em;color:#475569;">${tag("M", "#16a34a")}0.8 M☉ (small) ${tag("N", "#dc2626")}25 M☉ (large) ${tag("O", "#2563eb")}2 M☉ (medium)</div>
<div>${chip("Gas & Dust Cloud", "#e0e7ff")}${arrow}${chip("Protostar", "#e0e7ff")}${arrow}${chip("Main Sequence Star", "#fde68a")}</div>
<div>${tag("M", "#16a34a")} ${tag("O", "#2563eb")} <b style="font-size:.82em;">Small & medium stars:</b> ${chip("Red Giant", "#fecaca")}${arrow}${chip("White Dwarf", "#f1f5f9")}${arrow}${chip("Black Dwarf", "#cbd5e1")}</div>
<div>${tag("N", "#dc2626")} <b style="font-size:.82em;">Large stars:</b> ${chip("Red Supergiant", "#fed7aa")}${arrow}${chip("Supernova", "#fca5a5")}${arrow}${chip("Neutron Star <i>or</i> Black Hole", "#cbd5e1")}</div>
</div>`;
};
return {tbl, hr, path};
}Code
function buildStarQuiz(id, title, questions) {
const outer = html`<div id="${id}" style="font-family:'Inter',sans-serif; max-width:720px; margin:18px auto;"></div>`;
const header = html`<div style="background:linear-gradient(135deg,#667eea 0%,#764ba2 100%);color:#fff;border-radius:14px 14px 0 0;padding:18px 24px;">
<div style="font-size:1.1em;font-weight:700;display:flex;align-items:center;gap:8px;"><span style="font-size:1.2em;">📝</span> ${title}</div>
<div style="font-size:0.85em;opacity:0.85;margin-top:4px;">Select an answer for each question. <span class="quiz-score" style="font-weight:700;"></span></div>
</div>`;
const scoreEl = header.querySelector(".quiz-score");
let answered = 0, right = 0;
const body = html`<div style="border:1.5px solid #c7d2fe;border-top:none;border-radius:0 0 14px 14px;overflow:hidden;background:#f8f9ff;padding:16px;"></div>`;
questions.forEach((qq, qi) => {
const card = document.createElement("div");
card.style.cssText = "background:#fff;color:#1e1b4b;border-radius:12px;padding:16px 20px;margin-bottom:14px;box-shadow:0 2px 8px rgba(0,0,0,.08);";
card.innerHTML = `<p style="font-weight:700;margin:0 0 10px;color:#1e1b4b;">${qi+1}. ${qq.q}</p>` +
(qq.stimulus ? `<div style="background:#f8f9ff;border:1px solid #e0e7ff;border-radius:8px;padding:10px;margin:0 0 10px;">${qq.stimulus}</div>` : "");
qq.options.forEach((opt, oi) => {
const btn = document.createElement("button");
btn.innerHTML = opt;
btn.style.cssText = "display:block;width:100%;min-height:44px;text-align:left;padding:10px 14px;margin:6px 0;border:2px solid #e2e8f0;border-radius:8px;background:#fff;color:#1e1b4b;cursor:pointer;font-size:.95em;transition:border-color .2s,background .2s;";
btn.onmouseover = () => { if(!card.dataset.answered){ btn.style.borderColor="#667eea";btn.style.background="#f0f0ff"; }};
btn.onmouseout = () => { if(!card.dataset.answered){ btn.style.borderColor="#e2e8f0";btn.style.background="#fff"; }};
btn.onclick = () => {
if(card.dataset.answered) return;
card.dataset.answered = "true";
card.querySelectorAll("button").forEach(b => {
b.style.cursor="default"; b.onmouseover=null; b.onmouseout=null;
b.style.borderColor="#e2e8f0"; b.style.background="#f8fafc"; b.style.color="#475569";
});
answered++;
if(oi === qq.correct){
right++;
btn.style.borderColor="#48bb78";btn.style.background="#f0fff4";btn.style.color="#276749";btn.style.fontWeight="700";
fb.innerHTML = "✅ Correct! " + qq.explanation;
fb.style.color="#276749";fb.style.background="#f0fff4";
} else {
btn.style.borderColor="#fc8181";btn.style.background="#fff5f5";btn.style.color="#9b2c2c";btn.style.fontWeight="700";
const correctBtn = card.querySelectorAll("button")[qq.correct];
correctBtn.style.borderColor="#48bb78";correctBtn.style.background="#f0fff4";correctBtn.style.color="#276749";correctBtn.style.fontWeight="700";
fb.innerHTML = "❌ " + qq.explanation;
fb.style.color="#9b2c2c";fb.style.background="#fff5f5";
}
fb.style.padding="10px 14px";fb.style.marginTop="8px";fb.style.borderRadius="8px";
scoreEl.textContent = `Score: ${right}/${answered} (of ${questions.length})`;
};
card.appendChild(btn);
});
const fb = document.createElement("div");
fb.style.cssText = "border-radius:8px;font-size:.9em;transition:all .3s;";
card.appendChild(fb);
body.appendChild(card);
});
outer.appendChild(header);
outer.appendChild(body);
return outer;
}Code
buildStarQuiz("star-summative-quiz", "⭐ Study Guide Quiz — Star Life Cycles", [
{
q: "Use the H-R diagram to decide which row correctly gives the life stage of each star.",
stimulus: quizStimuli.tbl(
["Star", "Surface temp.", "Luminosity (Suns)"],
[["Sirius A", "9,900 K", "25"], ["Aldebaran", "3,900 K", "500"], ["Sirius B", "25,000 K", "0.03"]]
) + quizStimuli.hr([
[9900, 25, "Sirius A", 8, -6, "start"],
[3900, 500, "Aldebaran", 8, -8, "start"],
[25000, 0.03, "Sirius B", 8, 14, "start"]
]),
options: [
"Sirius A: Giant · Aldebaran: Main Sequence · Sirius B: White Dwarf",
"Sirius A: Main Sequence · Aldebaran: Supergiant · Sirius B: Main Sequence",
"Sirius A: White Dwarf · Aldebaran: Giant · Sirius B: Main Sequence",
"Sirius A: Main Sequence · Aldebaran: Giant · Sirius B: White Dwarf"
],
correct: 3,
explanation: "Match each star's temperature and luminosity to a region. Sirius A falls on the main-sequence curve. Aldebaran is cool but far brighter than the Sun, so it plots in the Giants region. Sirius B is hot but very dim, so it plots below the main sequence with the White Dwarfs."
},
{
q: "A 0.5-solar-mass star and a 25-solar-mass star both form from a gas and dust cloud. At what point do their life cycles first follow different pathways?",
options: [
"Right away, as soon as the cloud begins to collapse",
"As soon as the protostar forms",
"After the main sequence stage — mass decides what comes next",
"Only at the very end, when each star dies"
],
correct: 2,
explanation: "All stars share the early stages. Once a star leaves the main sequence, its mass decides the pathway: small and medium stars swell into red giants, while large stars become red supergiants."
},
{
q: "Using the life cycle model, which row shows what is left after the final stages of Star M (0.8 solar masses), Star N (25 solar masses), and Star O (2 solar masses)?",
stimulus: quizStimuli.path(),
options: [
"M: neutron star · N: white dwarf · O: black hole",
"M: white dwarf · N: neutron star or black hole · O: white dwarf",
"M: white dwarf · N: white dwarf · O: white dwarf",
"M: black hole · N: neutron star · O: neutron star"
],
correct: 1,
explanation: "Sort each star by size first. M and O are small-to-medium stars: red giant, then white dwarf. N is a large star: red supergiant, supernova, then a neutron star or black hole."
},
{
q: "Fossils show that sunlight has supported life on Earth for over 3 billion years. Use the table to decide which process best explains the Sun's energy.",
stimulus: quizStimuli.tbl(
["Possible energy source", "How long it could power the Sun"],
[["Burning fuel (chemical)", "about 10,000 years"],
["Gravitational contraction", "about 30 million years"],
["Hydrogen fusion (nuclear)", "about 10 billion years"]]
),
options: [
"Burning fuel, because chemical reactions are the most familiar on Earth",
"Gravitational contraction, because 30 million years is a long time",
"Hydrogen fusion, because it is the only source that lasts longer than 3 billion years",
"Hydrogen fusion, because it lasts the shortest time"
],
correct: 2,
explanation: "Compare each time span to the evidence (over 3 billion years). Only hydrogen fusion — turning hydrogen into helium and releasing energy — can last that long."
},
{
q: "A star's core is observed making carbon, oxygen, neon, and magnesium. Which statement is supported by the table?",
stimulus: quizStimuli.tbl(
["Stage", "Elements formed in the core"],
[["Main Sequence", "He"],
["Red Giant", "C, O, Ne, Mg"],
["Red Supergiant", "Na, Si, S, Ar, Ca"],
["Massive Red Supergiant", "Fe, Ni"]]
),
options: [
"The star is a red giant; a main-sequence star only forms helium",
"The star is on the main sequence, like most stars",
"The star is a massive red supergiant, since it is forming heavy elements",
"The star has already exploded as a supernova"
],
correct: 0,
explanation: "Match the elements to the stage. C, O, Ne, and Mg appear in the Red Giant row. Main-sequence stars form only helium, and the heavier Fe and Ni come later."
},
{
q: "A gold ring is made of atoms with atomic number 79 (heavier than iron). Which explanation best accounts for where those atoms were made?",
options: [
"Fusion in the core of the Sun",
"Fusion in the core of any main-sequence star",
"Fusion in a red giant, like the Sun will become",
"A supernova explosion of a massive star, long before the Sun formed"
],
correct: 3,
explanation: "Fusion in star cores builds elements only up to iron. Elements heavier than iron form when certain massive stars explode as supernovae. The ring's atoms came from stars that died before our solar system formed."
},
{
q: "The top three rows show the lab spectra of three elements. The bottom row shows the spectrum of an unknown star. Which elements does the star contain?",
stimulus: (() => {
const refs = [["Hydrogen", [20, 55, 80]], ["Sodium", [40, 43, 70]], ["Calcium", [10, 30, 65]], ["Unknown star", [10, 20, 30, 55, 65, 80]]];
const bars = refs.map(([name, lines], i) => `<text x="0" y="${i * 34 + 18}" font-size="10" font-weight="700" fill="#1e1b4b">${name}</text>
<rect x="80" y="${i * 34 + 4}" width="260" height="22" fill="url(#spec)" stroke="#334155"/>
${lines.map(l => `<line x1="${80 + l * 2.6}" x2="${80 + l * 2.6}" y1="${i * 34 + 4}" y2="${i * 34 + 26}" stroke="#000" stroke-width="2.5"/>`).join("")}`).join("");
return `<svg viewBox="0 0 350 140" style="width:100%;height:auto;max-width:480px;display:block;margin:auto;" role="img" aria-label="Spectra with dark absorption lines for hydrogen, sodium, calcium and an unknown star. The unknown star's lines match the hydrogen lines and the calcium lines.">
<defs><linearGradient id="spec" x1="0" x2="1"><stop offset="0" stop-color="#8b5cf6"/><stop offset=".25" stop-color="#3b82f6"/><stop offset=".5" stop-color="#22c55e"/><stop offset=".75" stop-color="#facc15"/><stop offset="1" stop-color="#ef4444"/></linearGradient></defs>${bars}</svg>`;
})(),
options: [
"Hydrogen only",
"Hydrogen and calcium",
"Sodium and calcium",
"Hydrogen, sodium, and calcium"
],
correct: 1,
explanation: "Each element absorbs light at its own set of wavelengths, like a fingerprint. Every dark line in the unknown spectrum must be matched to a reference. The lines match hydrogen's and calcium's, and none match sodium's."
},
{
q: "Star X has 20 solar masses, Star Y has 0.5 solar masses, and Star Z has 5 solar masses. Which list orders their lifespans from shortest to longest?",
stimulus: quizStimuli.tbl(
["Mass (Suns)", "Approximate lifespan"],
[["0.5", "55 billion years"], ["2", "1.8 billion years"], ["5", "180 million years"], ["20", "6 million years"]]
),
options: [
"X, Z, Y",
"Y, Z, X",
"Z, X, Y",
"X, Y, Z"
],
correct: 0,
explanation: "Find each mass in the table. The most massive star (X) has the shortest life: it burns through its fuel much faster, even though it has more of it. The least massive star (Y) lives the longest."
},
{
q: "Star W has a cool surface temperature of 3,200 K, but it is 60,000 times more luminous than the Sun. What does this combination tell you about Star W?",
options: [
"It is very small, like a white dwarf",
"It is a main-sequence star, because cool stars are always bright",
"Its temperature reading must be wrong",
"It must be enormous — a cool surface only gives off this much light if it is very large"
],
correct: 3,
explanation: "Luminosity depends on both temperature and surface area. Each patch of a 3,200 K surface is dim, so Star W must have an enormous surface to be so bright. On the H-R diagram that places it in the upper right, with the supergiants."
},
{
q: "The Sun's surface is about 5,800 K, but its core is about 15,000,000 K. What best explains this difference?",
options: [
"The core is closer to Earth, so it is hotter",
"Fusion happens at the surface, which loses heat to space",
"Fusion releases energy in the core, and that energy spreads outward and cools before leaving the surface as radiation",
"The core is burning a chemical fuel that gets hotter than the surface"
],
correct: 2,
explanation: "Nuclear fusion takes place in the core, where the temperature and pressure are extreme. The energy flows outward to the surface and is radiated into space, and some of it reaches Earth."
}
])