In first-order logic, we can use counting quantifier to express ''there exists at least k elements that satisfy a property '', i.e., $\exists_{\geq k} x\colon\varphi(x)$ where $k$ is a integer. For example, $\exists_{\geq 2} x\colon\varphi(x)$ is a shorthand for $\exists x_1\exists x_2(\varphi(x_1)\wedge\varphi(x_2)\wedge x_1\neq x_2)$.
Here is my question. Given a finite set $\Delta$, how to express ''there exists a subset $X$ of $\Delta$ which is such that at least $50$ percent of $X$ satisfy a property''?
At first, I used $\exists X \big [X\subseteq\Delta\wedge\exists_{\geq\lfloor\frac{1}{2}\cdot|X|\rfloor} x\colon [x\in X\wedge\varphi(x)]\big ]$. But it is not a first order formula, and the length of $\exists_{\geq\lfloor\frac{1}{2}\cdot|X|\rfloor} x\colon [x\in X\wedge\varphi(x)]$ is not fixed as the value of $\lfloor\frac{1}{2}\cdot|X|\rfloor$ is not fixed.
Let $W$ be the subset of $X$ consisting of the elements that satisfy the property in question. The main issue is how to express the statement "the cardinality of $W$ is at least half the cardinality of $X$". We can express this by noting that it is equivalent to the existence of a function $f\colon X\to W$ such that the inverse image of any singleton set in $W$ has at most two elements.
So therefore: $$ \exists f\colon X\to W,\, \forall w\in W, \exists_{\le2} x\in X,\, f(x)=w. $$ (I assume you can already express $\exists_{\le2}$ in terms of more basic logical constructs. I am using functional notation, but of course functions from $X$ to $W$ can be identified with certain subsets of $X\times W$, and so all of these pieces could be expressed entirely within elementary set theory if desired.)