I recently learned about the 5/8 theorem, which states that if the probability that any two random elements in a group commute exceeds 5/8, then the group must be abelian. I think its interesting seeing probability and group theory together, which led me to think of this question.
This is my work so far, which has a good possibility of being flawed. First, consider all binary operations $\varphi : G\times G \to G$, which given $|G|=n$ we can count as $|G|^{|G\times G|^2} = n^{n^2}$.
Next, consider all binary operations that fail to have an identity $e \in G$. If $\varphi(g,e)\neq g$ (or $\varphi(e,g)\neq g$) for any single $g \in G$, we can throw out all other possible functions given by the other elements in $G- \{g\}$, which is given by $(n-1)^{(n-1)^2}$ operations. There are $n^2$ elements in $|G\times G|$ that each have $(n-1)$ ways to fail, so the number of binary operations that fail to have an identity element should be given by $$n^2(n-1)(n-1)^{(n-1)^2}=n^2(n-1)^{(n-1)^2+1}$$ Hence, we can get an upper bound for how many binary operations can form groups as $$n^{n^2}-n^2(n-1)^{(n-1)^2+1}$$ For inverses, I think the same argument can be made as the above, hence an upper bound after considering inverses is given by $$n^{n^2}-2n^2(n-1)^{(n-1)^2+1}$$ I have no idea how to even get started with associativity! Further, I have never been fantastic at counting problems, so I am sure I made a flaw in my argument thus far. Any progress or criticisms are very much welcome.