Let $X \sim \mathsf{Bern}(p=.2)\equiv\mathsf{Binom}(n=1, p=.2).$ In R, where qbinom
is the inverse CDF (quantile function) of a binomial distribution a median $\eta = 0.$
qbinom(.5, 1, .2)
[1] 0
$P(X \le 0) = P(X = 0) = 0.8 \ge 1/2.$
dbinom(0, 1, .2)
[1] 0.8
And obviously, $P(X \ge 0) = 1 \ge 1/2.$
The CDF of $X$ is plotted below. The median of $X$ is taken to be the value
at which the CDF 'curve' is (or 'crosses') $1/2.$
curve(pbinom(x, 1, .2), -.5, 1.5, n=10001, xaxs="i", ylab="CDF")
k = 0:1; cdf = pbinom(k, 1, .2)
points(k,cdf,pch=19)
abline(h = .5, col="blue", lwd=2, lty="dotted")
Also, for context, if we simulate $1000$ observations from this distribution, we get $805$ Failures (0) and $195$ Successes. According to R, the sample median is also $0.$
set.seed(2020)
x = rbinom(1000, 1, .2)
table(x)
x
0 1
805 195
summary(x)
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.000 0.000 0.000 0.195 0.000 1.000