4. Toss a six-sided die with 1, 2, $3,4,5,6$ dots on each face randomly, the mathematical expectation of the number of dots that appear (i.e., the face that is up) is ( ).
(A) 3
(B) 3.5
(C) 4
(D) 4.5
4.B.

The probability of rolling a 1, 2, 3, 4, 5, or 6 is $\frac{1}{6}$ each, so the mathematical expectation of the number of points that appear is
$$
\frac{1}{6}(1+2+3+4+5+6)=\frac{21}{6}=3.5 .
$$