Pushdown Automata: How can I recognize a ratio threshold between two symbols in a string?
Assume you have to check whether $\#A \ge \frac 43\#B$, then this is equivalent to  $3\#A \ge 4\#B$. This can be solved: just push 3 symbols for every $A$ and pop four of them for every $B$ (changing this a little when the number gets negative).

Adapt this to your fraction.