@@ -442,7 +442,7 @@ ax.axis('off')
442442
443443# Title
444444ax.text(5, 9.5, r'Binomial Formula Breakdown: $n=3, k=2, p=0.6$',
445- ha='center', va='top', fontsize=18 , weight='bold')
445+ ha='center', va='top', fontsize=24 , weight='bold')
446446
447447# Draw the three sequences
448448sequences = [
@@ -464,47 +464,47 @@ for seq_text, x, y in sequences:
464464
465465 # Sequence text
466466 ax.text(x, y, seq_text, ha='center', va='center',
467- fontsize=16 , weight='bold', family='monospace')
467+ fontsize=22 , weight='bold', family='monospace')
468468
469469 # Probability calculation below
470470 ax.text(x, y-0.8, f'{p}×{p}×{1-p:.1f}', ha='center', va='top',
471- fontsize=14 , style='italic')
471+ fontsize=20 , style='italic')
472472 ax.text(x, y-1.2, f'= {prob_each:.3f}', ha='center', va='top',
473- fontsize=14 , weight='bold')
473+ fontsize=20 , weight='bold')
474474
475475# Count annotation
476476ax.text(5, 5.5, r'$\binom{3}{2} = 3$ sequences',
477- ha='center', va='center', fontsize=15 , weight='bold',
477+ ha='center', va='center', fontsize=20 , weight='bold',
478478 bbox=dict(boxstyle='round', facecolor='lightyellow', edgecolor='orange', linewidth=2))
479479
480480# Formula breakdown
481- ax.text(5, 4.2, 'Formula:', ha='center', va='center', fontsize=15 , weight='bold')
481+ ax.text(5, 4.2, 'Formula:', ha='center', va='center', fontsize=20 , weight='bold')
482482ax.text(5, 3.6, r'$P(X=2) = \binom{3}{2} \cdot p^2 \cdot (1-p)^1$',
483- ha='center', va='center', fontsize=15 )
483+ ha='center', va='center', fontsize=20 )
484484ax.text(5, 2.9, r'$= 3 \times 0.36 \times 0.4$',
485- ha='center', va='center', fontsize=15 )
485+ ha='center', va='center', fontsize=20 )
486486ax.text(5, 2.3, r'$= 0.432$',
487- ha='center', va='center', fontsize=16 , weight='bold',
487+ ha='center', va='center', fontsize=22 , weight='bold',
488488 bbox=dict(boxstyle='round', facecolor='lightgreen', edgecolor='green', linewidth=2))
489489
490490# Annotations with arrows - repositioned to avoid all overlaps
491491ax.annotate('Count sequences', xy=(4.0, 5.5), xytext=(0.5, 4.8),
492492 arrowprops=dict(arrowstyle='->', color='orange', lw=2),
493- fontsize=13 , color='orange', weight='bold')
493+ fontsize=18 , color='orange', weight='bold')
494494
495495ax.annotate('Each sequence\nhas same\nprobability', xy=(8.1, 7), xytext=(8.5, 8.5),
496496 arrowprops=dict(arrowstyle='->', color='steelblue', lw=2),
497- fontsize=13 , color='steelblue', weight='bold', ha='left')
497+ fontsize=18 , color='steelblue', weight='bold', ha='left')
498498
499499ax.annotate('Multiply!', xy=(6.0, 2.5), xytext=(7.8, 1.8),
500500 arrowprops=dict(arrowstyle='->', color='green', lw=2),
501- fontsize=13 , color='green', weight='bold')
501+ fontsize=18 , color='green', weight='bold')
502502
503503# Bottom explanation
504504ax.text(5, 1.0, 'Why it works: Each sequence occurs with probability 0.432/3 = 0.144,',
505- ha='center', va='center', fontsize=13 , style='italic')
505+ ha='center', va='center', fontsize=18 , style='italic')
506506ax.text(5, 0.5, 'and there are 3 ways to get exactly 2 successes, so total = 3 × 0.144 = 0.432',
507- ha='center', va='center', fontsize=13 , style='italic')
507+ ha='center', va='center', fontsize=18 , style='italic')
508508
509509plt.tight_layout()
510510plt.savefig('ch07_binomial_formula_breakdown.svg', format='svg', bbox_inches='tight')
0 commit comments