<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>valore atteso | The Math of Things</title><link>https://mathofthings.netlify.app/tag/valore-atteso/</link><atom:link href="https://mathofthings.netlify.app/tag/valore-atteso/index.xml" rel="self" type="application/rss+xml"/><description>valore atteso</description><generator>Wowchemy (https://wowchemy.com)</generator><language>en-us</language><lastBuildDate>Tue, 07 Jul 2026 00:00:00 +0000</lastBuildDate><image><url>https://mathofthings.netlify.app/media/icon_hu6c6ed29f698bb57c24ca81ba64928043_3770_512x512_fill_lanczos_center_3.png</url><title>valore atteso</title><link>https://mathofthings.netlify.app/tag/valore-atteso/</link></image><item><title>Calcolo delle Probabilità</title><link>https://mathofthings.netlify.app/slides/probabilita-introduzione/</link><pubDate>Tue, 07 Jul 2026 00:00:00 +0000</pubDate><guid>https://mathofthings.netlify.app/slides/probabilita-introduzione/</guid><description>&lt;section class="mot-hero" data-background-color="#ed6f5c" data-transition="zoom">
&lt;div id="particles-prob-hero" class="bg-particles" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1;">&lt;/div>
&lt;p class="mot-kicker" style="color: white; position: relative; z-index: 10;">matematica per il triennio&lt;/p>
&lt;h1 style="color: white; position: relative; z-index: 10;">Calcolo delle &lt;span class="math-word" style="color: white; font-style: italic;">Probabilità&lt;/span>&lt;/h1>
&lt;p class="mot-tagline" style="color: rgba(255,255,255,0.95); font-size: 1.3em; position: relative; z-index: 10;">quando la &lt;em style="font-style: italic; color: white;">fortuna&lt;/em>&lt;br>incontra la &lt;em style="font-style: italic; color: white;">matematica&lt;/em>&lt;/p>
&lt;p class="mot-meta" style="color: rgba(255,255,255,0.9); position: relative; z-index: 10;">prof. Diego Fantinelli &amp;mdash; The Math of Things&lt;/p>
&lt;/section>
&lt;hr>
&lt;section>
&lt;blockquote class="mot-quote">
"Dio non gioca a dadi con l'universo." — Albert Einstein
&lt;span class="quote-attr">Ma i matematici sì.&lt;/span>
&lt;/blockquote>
&lt;/section>
&lt;hr>
&lt;section class="mot-divider" data-background-color="#ed6f5c" data-transition="zoom" style="color: white;">
&lt;div id="particles-quando" class="bg-particles" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1;">&lt;/div>
&lt;h1 class="r-fit-text" style="position: relative; z-index: 10;">QUANDO ACCADE QUALCOSA?&lt;/h1>
&lt;/section>
&lt;section>
&lt;p class="mot-kicker">il concetto fondamentale&lt;/p>
&lt;h2>Che cos'è la &lt;em>probabilità&lt;/em>?&lt;/h2>
&lt;p class="mot-def fragment">La probabilità misura quanto è &lt;b>probabile&lt;/b> che accada un evento. È un numero tra 0 e 1.&lt;/p>
&lt;div class="mot-cols fragment" style="margin-top: 1.5rem;">
&lt;div class="mot-col">
&lt;p style="font-size: 0.85em">&lt;b>Evento impossibile:&lt;/b>&lt;/p>
&lt;p class="mot-result" style="font-size: 1.2em">P = 0&lt;/p>
&lt;p style="font-size: 0.75em">Non accade mai&lt;/p>
&lt;/div>
&lt;div class="mot-col">
&lt;p style="font-size: 0.85em">&lt;b>Evento certo:&lt;/b>&lt;/p>
&lt;p class="mot-result" style="font-size: 1.2em">P = 1&lt;/p>
&lt;p style="font-size: 0.75em">Accade sempre&lt;/p>
&lt;/div>
&lt;/div>
&lt;p class="fragment" style="font-size: 0.8em; margin-top: 2rem;">$0 \lt P(\text{evento}) \lt 1$ = &lt;b>probabilità che l'evento accada&lt;/b>&lt;/p>
&lt;/section>
&lt;section>
&lt;p class="mot-kicker">esperimento 1: il dado&lt;/p>
&lt;h2>Lanciamo un &lt;em>dado&lt;/em>!&lt;/h2>
&lt;div style="display: flex; justify-content: center; align-items: center; gap: 2rem; margin: 2rem 0;">
&lt;div style="font-size: 4rem; cursor: pointer; user-select: none; padding: 1rem;" id="dice-visual">🎲&lt;/div>
&lt;div style="text-align: left; font-size: 0.85em;">
&lt;p>&lt;b>Spazio campionario:&lt;/b>&lt;/p>
&lt;p>$\{1, 2, 3, 4, 5, 6\}$&lt;/p>
&lt;p style="margin-top: 1rem;">&lt;b>Probabilità di un numero:&lt;/b>&lt;/p>
&lt;p class="mot-result">$$P(\text{un numero}) = \frac{1}{6}$$&lt;/p>
&lt;/div>
&lt;/div>
&lt;button id="roll-btn" style="padding: 0.8rem 1.5rem; font-size: 1.1em; background: var(--mot-primary); color: white; border: none; border-radius: 8px; cursor: pointer; font-weight: 600;">Lancia il dado&lt;/button>
&lt;p id="dice-result" style="margin-top: 1.5rem; font-size: 1.2em; color: var(--mot-primary); font-weight: 600; min-height: 1.5em;">&lt;/p>
&lt;/section>
&lt;section>
&lt;p class="mot-kicker">la moneta non tradisce&lt;/p>
&lt;h2>Testa o &lt;em>Croce&lt;/em>?&lt;/h2>
&lt;div style="display: flex; justify-content: center; align-items: center; gap: 2rem; margin: 2rem 0;">
&lt;div style="font-size: 4rem; cursor: pointer; user-select: none; padding: 1rem;" id="coin-visual">🪙&lt;/div>
&lt;div style="text-align: left; font-size: 0.9em;">
&lt;p>&lt;b>Due esiti equiprobabili:&lt;/b>&lt;/p>
&lt;p class="mot-result" style="font-size: 1.1em">$$P(\text{Testa}) = P(\text{Croce}) = \frac{1}{2}$$&lt;/p>
&lt;/div>
&lt;/div>
&lt;button id="flip-btn" style="padding: 0.8rem 1.5rem; font-size: 1.1em; background: var(--mot-primary); color: white; border: none; border-radius: 8px; cursor: pointer; font-weight: 600;">Lancia la moneta&lt;/button>
&lt;p id="coin-result" style="margin-top: 1.5rem; font-size: 1.1em; min-height: 1.5em;">&lt;/p>
&lt;p class="fragment" style="font-size: 0.75em; margin-top: 1rem; color: #666;">Se la moneta è &lt;b>equa&lt;/b>, testa e croce hanno la stessa probabilità.&lt;/p>
&lt;/section>
&lt;hr>
&lt;section class="mot-divider" data-background-color="#ed6f5c" data-transition="zoom" style="color: white;">
&lt;div id="particles-sondaggi" class="bg-particles" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1;">&lt;/div>
&lt;h1 class="r-fit-text" style="position: relative; z-index: 10;">SONDAGGI &amp; STATISTICHE&lt;/h1>
&lt;/section>
&lt;section>
&lt;p class="mot-kicker">proporzionalità&lt;/p>
&lt;h2>Il &lt;em>sondaggio&lt;/em> della classe&lt;/h2>
&lt;p class="mot-def">Facciamo un rapido sondaggio: chi preferisce i dadi, chi la moneta, chi l'astrologia?&lt;/p>
&lt;div style="margin: 1.5rem auto 1rem; width: 95%; max-width: 750px;">
&lt;div style="margin: 0.8rem 0;">
&lt;div style="display: grid; grid-template-columns: 300px 1fr; align-items: center; gap: 1rem; margin-bottom: 1rem;">
&lt;span style="font-weight: 600; text-align: left;">Dadi&lt;/span>
&lt;div id="bar-dice" style="height: 35px; background: var(--mot-primary); width: 0%; border-radius: 4px; transition: width 0.3s; display: flex; align-items: center; justify-content: flex-end; padding-right: 10px; color: white; font-weight: 600; font-size: 0.95em;">&lt;/div>
&lt;/div>
&lt;div style="display: grid; grid-template-columns: 300px 1fr; align-items: center; gap: 1rem; margin-bottom: 1rem;">
&lt;span style="font-weight: 600; text-align: left;">Moneta&lt;/span>
&lt;div id="bar-coin" style="height: 35px; background: #3a6b8c; width: 0%; border-radius: 4px; transition: width 0.3s; display: flex; align-items: center; justify-content: flex-end; padding-right: 10px; color: white; font-weight: 600; font-size: 0.95em;">&lt;/div>
&lt;/div>
&lt;div style="display: grid; grid-template-columns: 300px 1fr; align-items: center; gap: 1rem;">
&lt;span style="font-weight: 600; text-align: left;">Astrologia&lt;/span>
&lt;div id="bar-astro" style="height: 35px; background: #999; width: 0%; border-radius: 4px; transition: width 0.3s; display: flex; align-items: center; justify-content: flex-end; padding-right: 10px; color: white; font-weight: 600; font-size: 0.95em;">&lt;/div>
&lt;/div>
&lt;/div>
&lt;/div>
&lt;div style="display: flex; gap: 1rem; justify-content: center; margin: 1.5rem 0;">
&lt;button onclick="voteFor('dice')" style="padding: 0.7rem 1.3rem; background: var(--mot-primary); color: white; border: none; border-radius: 6px; cursor: pointer; font-weight: 600;">Dadi&lt;/button>
&lt;button onclick="voteFor('coin')" style="padding: 0.7rem 1.3rem; background: #3a6b8c; color: white; border: none; border-radius: 6px; cursor: pointer; font-weight: 600;">Moneta&lt;/button>
&lt;button onclick="voteFor('astro')" style="padding: 0.7rem 1.3rem; background: #999; color: white; border: none; border-radius: 6px; cursor: pointer; font-weight: 600;">Astrologia&lt;/button>
&lt;/div>
&lt;p id="poll-stats" style="margin-top: 1.5rem; font-size: 0.55em; font-family: 'JetBrains Mono', monospace; font-weight: 600; color: var(--mot-primary); min-height: 1.8em;">&lt;/p>
&lt;/section>
&lt;hr>
&lt;section class="mot-divider" data-background-color="#ed6f5c" data-transition="zoom" style="color: white;">
&lt;div id="particles-gioco" class="bg-particles" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1;">&lt;/div>
&lt;h1 class="r-fit-text" style="position: relative; z-index: 10;">IL GIOCO&lt;/h1>
&lt;/section>
&lt;section>
&lt;p class="mot-kicker">il lotto italiano&lt;/p>
&lt;h2>Giocare alla &lt;em>lotteria&lt;/em>&lt;/h2>
&lt;div class="mot-cols fragment" style="margin-top: 1.5rem;">
&lt;div class="mot-col">
&lt;p style="font-size: 0.9em;">&lt;b>Numero totale:&lt;/b>&lt;/p>
&lt;p class="mot-result">90 numeri&lt;/p>
&lt;/div>
&lt;div class="mot-col">
&lt;p style="font-size: 0.9em;">&lt;b>Numero estratto:&lt;/b>&lt;/p>
&lt;p class="mot-result">1 numero&lt;/p>
&lt;/div>
&lt;/div>
&lt;p class="fragment" style="font-size: 0.85em; margin-top: 2rem;">&lt;b>Qual è la probabilità che vinca il mio numero?&lt;/b>&lt;/p>
&lt;p class="fragment mot-result">$$P(\text{vincere}) = \frac{1}{90} \approx 1.1\%$$&lt;/p>
&lt;p class="fragment mot-joke" style="margin-top: 1.5rem;">È più probabile che il tuo cognato ti presti soldi&lt;/p>
&lt;/section>
&lt;section>
&lt;p class="mot-kicker">il gioco della roulette&lt;/p>
&lt;h2>Una &lt;em>roulette&lt;/em> equa?&lt;/h2>
&lt;p class="mot-def fragment">La roulette francese ha 37 numeri (0–36). Se punti su un numero:&lt;/p>
&lt;div class="fragment" style="margin: 1.5rem 0;">
&lt;p class="mot-result" style="font-size: 1.1em">$$P(\text{vinci}) = \frac{1}{37} \approx 2.7\%$$&lt;/p>
&lt;p style="font-size: 0.9em; margin-top: 0.5rem;">Ma se vinci, il casinò ti paga solo 35 volte la puntata!&lt;/p>
&lt;/div>
&lt;p class="fragment" style="font-size: 0.85em; margin-top: 1.5rem;">&lt;b>Dovrebbe pagarti 36 volte&lt;/b> (37 − 1 per la puntata). Lui ne paga solo 35. Ecco il guadagno del casinò!&lt;/p>
&lt;p class="mot-joke fragment" style="margin-top: 1rem;">Il casinò non è truccato. È matematicamente sleale.&lt;/p>
&lt;/section>
&lt;section>
&lt;p class="mot-kicker">value &amp; risk&lt;/p>
&lt;h2>Il &lt;em>valore atteso&lt;/em> di un gioco&lt;/h2>
&lt;p class="mot-def fragment">Il valore atteso è quanto &lt;b>ci aspettiamo di guadagnare (o perdere) in media&lt;/b> da un gioco.&lt;/p>
&lt;p class="fragment" style="font-size: 0.85em; margin-top: 1.5rem;">Esempio: punto 1 euro sulla roulette su un numero:&lt;/p>
&lt;div class="fragment" style="margin: 1.5rem 0; font-family: 'JetBrains Mono', monospace; font-size: 0.85em;">
&lt;p>Vinci (prob 1/37): guadagni 35 euro&lt;/p>
&lt;p>Perdi (prob 36/37): perdi 1 euro&lt;/p>
&lt;/div>
&lt;p class="fragment mot-result">$$E = \frac{1}{37} \cdot 35 + \frac{36}{37} \cdot (-1) =$$&lt;/p>
&lt;p class="fragment mot-result">$$= \frac{35 - 36}{37} = -\frac{1}{37} \approx -0.027$$&lt;/p>
&lt;p class="fragment" style="font-size: 0.85em; margin-top: 1rem;">In media, &lt;b>perdi 2.7 centesimi ogni volta&lt;/b> che punti 1 euro. Su 1000 scommesse: 27 euro in meno.&lt;/p>
&lt;/section>
&lt;section>
&lt;p class="mot-kicker">il verdetto&lt;/p>
&lt;h2>Gioco &lt;em>equo&lt;/em> vs gioco &lt;em>truccato&lt;/em>&lt;/h2>
&lt;div class="mot-cols fragment" style="margin-top: 1.5rem;">
&lt;div class="mot-col" style="border-left: 4px solid var(--mot-primary); padding-left: 1rem;">
&lt;p style="font-size: 0.9em; font-weight: 600; color: var(--mot-primary);">GIOCO EQUO&lt;/p>
&lt;p style="font-size: 0.8em; margin-top: 0.5rem;">Valore atteso = 0&lt;/p>
&lt;p style="font-size: 0.75em; color: #666;">Non si guadagna né si perde&lt;/p>
&lt;p style="font-size: 0.75em; color: #666; margin-top: 0.5rem;">Esempio: lanciare una moneta e scommettere&lt;/p>
&lt;/div>
&lt;div class="mot-col" style="border-left: 4px solid #c2185b; padding-left: 1rem;">
&lt;p style="font-size: 0.9em; font-weight: 600; color: #c2185b;">GIOCO SLEALE&lt;/p>
&lt;p style="font-size: 0.8em; margin-top: 0.5rem;">Valore atteso &lt; 0&lt;/p>
&lt;p style="font-size: 0.75em; color: #666;">Il banco ha vantaggio&lt;/p>
&lt;p style="font-size: 0.75em; color: #666; margin-top: 0.5rem;">Esempio: roulette, lotto, gratta e vinci&lt;/p>
&lt;/div>
&lt;/div>
&lt;/section>
&lt;hr>
&lt;section class="mot-divider" data-background-color="#ed6f5c" data-transition="zoom" style="color: white;">
&lt;div id="particles-riassunto" class="bg-particles" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1;">&lt;/div>
&lt;h1 class="r-fit-text" style="position: relative; z-index: 10;">IL RIASSUNTO&lt;/h1>
&lt;/section>
&lt;section>
&lt;p class="mot-kicker">in breve&lt;/p>
&lt;h2>Tre lezioni dalla &lt;em>probabilità&lt;/em>&lt;/h2>
&lt;ol style="font-size: 0.95em; line-height: 1.8; text-align: left; display: inline-block;">
&lt;li class="fragment">&lt;b>La probabilità misura la rarità:&lt;/b> da 0 (impossibile) a 1 (certo).&lt;/li>
&lt;li class="fragment">&lt;b>I dadi e le monete sono equi:&lt;/b> tutti gli esiti hanno la stessa probabilità.&lt;/li>
&lt;li class="fragment">&lt;b>Il valore atteso racconta la verità:&lt;/b> se è negativo, il gioco è contro di te. 📉&lt;/li>
&lt;/ol>
&lt;p class="mot-joke fragment" style="margin-top: 2rem;">La buona notizia: la matematica non mente. La cattiva notizia: il casinò sa bene di mentire.&lt;/p>
&lt;/section>
&lt;section class="mot-hero" data-background-color="#ed6f5c" data-transition="zoom" style="color: white;">
&lt;div id="particles-finale" class="bg-particles" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1;">&lt;/div>
&lt;h1 style="font-size: 2.5em; color: white; position: relative; z-index: 10;">Il gioco è solo &lt;em style="color: white; font-style: italic;">uno specchio&lt;/em>&lt;/h1>
&lt;p style="font-size: 1.2em; margin-top: 1.5rem; color: white; position: relative; z-index: 10;">La probabilità ti insegna a &lt;b>leggere il mondo&lt;/b>.&lt;/p>
&lt;p class="mot-meta" style="color: rgba(255,255,255,0.95); margin-top: 2rem; position: relative; z-index: 10;">Prossima lezione: Calcoliamo le probabilità sul serio&lt;/p>
&lt;/section>
&lt;hr>
&lt;style>
@keyframes flip-coin {
0% { transform: rotateY(0deg) rotateX(0deg); }
50% { transform: rotateY(720deg) rotateX(180deg); }
100% { transform: rotateY(1080deg) rotateX(360deg); }
}
@keyframes bounce-dice {
0% { transform: translateY(0) rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
25% { transform: translateY(-40px) rotateX(180deg) rotateY(180deg) rotateZ(90deg); }
50% { transform: translateY(-70px) rotateX(360deg) rotateY(360deg) rotateZ(180deg); }
75% { transform: translateY(-40px) rotateX(540deg) rotateY(540deg) rotateZ(270deg); }
100% { transform: translateY(0) rotateX(720deg) rotateY(720deg) rotateZ(360deg); }
}
#dice-visual {
display: inline-block;
perspective: 1000px;
font-weight: bold;
font-size: 2.5em;
}
#dice-visual.rolling {
animation: bounce-dice 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
#coin-visual {
display: inline-block;
perspective: 1000px;
font-weight: bold;
font-size: 2.8em;
}
#coin-visual.flipping {
animation: flip-coin 0.8s ease-in-out;
}
.mot-hero h1 em,
.mot-hero .mot-tagline em {
color: rgba(255,255,255,0.95);
font-style: italic;
}
/* Particles bianchi su sfondo corallo */
.reveal section[data-background-color="#ed6f5c"] svg line,
.reveal section[data-background-color="#ed6f5c"] svg circle {
stroke: rgba(255, 255, 255, 0.4) !important;
fill: rgba(255, 255, 255, 0.2) !important;
}
&lt;/style>
&lt;script src="https://cdn.jsdelivr.net/npm/tsparticles@2.12.0/tsparticles.bundle.min.js">&lt;/script>
&lt;script>
// Particles bianchi su sfondo corallo
(function () {
if (typeof tsParticles === 'undefined') return;
var config = {
fpsLimit: 60,
particles: {
number: { value: 80, density: { enable: true, area: 800 } },
color: { value: '#ffffff' },
opacity: { value: { min: 0.2, max: 0.5 } },
size: { value: { min: 0.5, max: 3 } },
move: {
enable: true,
speed: { min: 0.2, max: 1.5 },
direction: 'none',
random: true,
straight: false,
outModes: { default: 'out' }
}
},
interactivity: {
events: { onHover: { enable: false }, onClick: { enable: false } }
},
detectRetina: true
};
// Circular trajectories
config.particles.move.spin = { enable: true, acceleration: 0 };
// Carica particles su tutti i div con sfondo corallo
var particleIds = ['particles-prob-hero', 'particles-quando', 'particles-sondaggi', 'particles-gioco', 'particles-riassunto', 'particles-finale'];
particleIds.forEach(function(id) {
var elem = document.getElementById(id);
if (elem) {
tsParticles.load(id, config);
}
});
})();
// Sondaggio
let pollVotes = { dice: 0, coin: 0, astro: 0 };
function voteFor(option) {
pollVotes[option]++;
updatePoll();
}
function updatePoll() {
const total = pollVotes.dice + pollVotes.coin + pollVotes.astro;
if (total === 0) return;
const pct = (val) => total > 0 ? Math.round((val / total) * 100) : 0;
document.getElementById('bar-dice').style.width = (pct(pollVotes.dice) * 0.8) + '%';
document.getElementById('bar-dice').textContent = pct(pollVotes.dice) + '%';
document.getElementById('bar-coin').style.width = (pct(pollVotes.coin) * 0.8) + '%';
document.getElementById('bar-coin').textContent = pct(pollVotes.coin) + '%';
document.getElementById('bar-astro').style.width = (pct(pollVotes.astro) * 0.8) + '%';
document.getElementById('bar-astro').textContent = pct(pollVotes.astro) + '%';
const stats = `Voti totali: ${total} | Dadi: ${pollVotes.dice} (${pct(pollVotes.dice)}%) | Moneta: ${pollVotes.coin} (${pct(pollVotes.coin)}%) | Astrologia: ${pollVotes.astro} (${pct(pollVotes.astro)}%)`;
document.getElementById('poll-stats').textContent = stats;
}
// Dado
document.getElementById('roll-btn').addEventListener('click', function() {
const diceVisual = document.getElementById('dice-visual');
const result = Math.floor(Math.random() * 6) + 1;
diceVisual.classList.remove('rolling');
void diceVisual.offsetWidth;
diceVisual.classList.add('rolling');
document.getElementById('dice-result').textContent = '';
setTimeout(() => {
diceVisual.classList.remove('rolling');
document.getElementById('dice-result').textContent = 'Risultato: ' + result;
}, 800);
});
// Moneta
document.getElementById('flip-btn').addEventListener('click', function() {
const coinVisual = document.getElementById('coin-visual');
const result = Math.random() > 0.5 ? 'Testa' : 'Croce';
coinVisual.classList.remove('flipping');
void coinVisual.offsetWidth;
coinVisual.classList.add('flipping');
document.getElementById('coin-result').textContent = '';
setTimeout(() => {
coinVisual.classList.remove('flipping');
document.getElementById('coin-result').textContent = 'Risultato: ' + result;
}, 800);
});
&lt;/script></description></item></channel></rss>