#  don't work with TOC?

If i write this line of code

\subsection{Ranger $$n$$ boules distinguables dans $$M$$ boîtes}

I obtain an error over the second \)

(./Probabilité.toc

./Probabilité.toc:8: LaTeX Error: Bad math environment delimiter.

while if I write

\subsection{Ranger $n$ boules distinguables dans $M$ boîtes}

everything is ok. Why? I'm doing something wrong?

-

$$and$$ are not robust, you need to \protect them. Or load package fixltx2e that makes them robust.