Mathematical function for weighting football results Let's assume team A has scored x goals, and team B has scored y goals in a match.
I'm trying to find a function that returns a number between 0 and 1 based on the goals from the match.
Ideally, the function would reach 1 when y is 0 and x approaches infinity.
I have a very simple function that works almost entirely as desired, and that is x/(x+y).
The problem with this function is that 1-0 gives the same function output as 10-0, 1.
 A: My current best suggestion would be
$$
\frac{x+n}{x+y+2n}
$$
for some number $n$ depending on how much weight you want to put on the number of goals.
A: One possibility is
$$f(x,y)=\frac{x+1}{x+y+2}$$
This never equals $1$ or $0$, but the more lopsided the win for $x$ the closer it gets to $1$. This also is symmetric in $x$ and $y$, as you said you wanted in a comment.
The score $1-0$ gives a value of $\frac 23$, while $10-0$ gives a value of $\frac{11}{12}$. This seems to meet all your criteria. Ties give the value $\frac 12$, which makes sense. This does show, however, that you can get the same result for differing scores. Is this acceptable?
A: If you are willing to make it more difficult to compute by hand, I would recommend a logistic function. Logistic functions will give you a very nice curve which, for probability purposes, is often better. A logistic curve could take a form like this:
$$ \dfrac{1}{1+e^{-k(x-y)}} $$ you could vary $k$ based upon how quickly you wanted the function to approach $1$. This will approach $0$ when $y$ is much larger than $x$, and will be $\frac{1}{2}$ when $y=x$
