Consider the function to find the probability of flipping $N$ coins and getting $n$ heads:
$$P(N,n)=\frac{N!}{2^N}\frac{1}{n!\,\,(N-n)!}$$
For a fixed $N$, how do we find the maxima of this function analytically?
Consider the function to find the probability of flipping $N$ coins and getting $n$ heads:
$$P(N,n)=\frac{N!}{2^N}\frac{1}{n!\,\,(N-n)!}$$
For a fixed $N$, how do we find the maxima of this function analytically?
Another formulation of this function is $$ P(N,n)=\frac{1}{2^N}\binom{N}{n} $$ For a fixed $N$, then this reduces to finding the maxima of $\binom{N}{n}$ since $2^N$ is constant. This is known to occur when $n$ is $N/2$ when $N$ is even, or at both $(N-1)/2$ an $(N+1)/2$ when $N$ is odd (see Pascal's triangle). There are proofs of this at How do you prove ${n \choose k}$ is maximum when $k$ is $ \lceil \tfrac n2 \rceil$ or $ \lfloor \tfrac n2\rfloor $?.
This makes some sense, since you'd expect the most likely situation to be an equal number of heads and tails (or as close to an equal number as you can get).
Two simple, and essentially equivalent, ways would be to:
Treat integer-valued parameters as floor functions. For instance, if I wanted to analyze the function $$ f(n) := \frac{\sin n}{n} \text{ where } n \in \mathbb{Z} $$ I could look at the function $$ g(x) := f(\lfloor x \rfloor) = \frac{\sin \lfloor x \rfloor}{\lfloor x \rfloor} $$ and then apply ordinary calculus optimization techniques to the function. You would not have differentiability at the exact integer values but in most practical cases this is unlikely to be a concern (and probably extremely obvious when it comes up). (You can think of this technique as a continuation of the function $f$ to arbitrary real values, albeit in a lazy way.)
You could use items from discrete calculus instead; a lot have natural analogues to results from "continuous" calculus. For instance, define your derivative by $$ \Delta f(x) := f(x+1) - f(x) $$ You'll notice still that a function tends to have a maximum at $x_0$ if $\Delta f(x_0-1) > 0$ and $\Delta f(x_0) < 0$.
No doubt there are other means to do this; these are just the first two that come to mind.