R, 60 4747 28 bytes
f=functionfunction(a,b)if(runifa+b+rgeom(1)>0,.9)f(a,b+1)else a+b
This is an unnamed function object that accepts two numbers and returns a number. It does not use recursion.
As xnor pointed out in a comment, this problem can be viewed as simply adding two numbers plus a geometric random variable with failure probability 1/10.
Why is that true? Think about it in terms of recursion, as it's described in the post. In each iteration we have a 10% chance of adding 1 and recursing, and a 90% chance of exiting the function without further addition. Each iteration is its own independent Bernoulli trial with outcomes "add 1, recurse" (failure) and "exit" (success). Thus the probability of failure is 1/10 and the probability of success is 9/10.
When dealing with a series of independent Bernoulli trials, the number of trials needed to obtain a single success follows a geometric distribution. In our case, each recursion means adding 1, so when we do finally exit the function, we've essentially counted the number of failures that occurred before the first success. That means that the amount that the result will be off by is a random variate from a geometric distribution.
Here we can take advantage of R's expansive suite of probability distribution built-ins and use rgeom
, which returns a random value from a geometric distribution.
Ungolfed:
f <- function(a, b) {
# Check a random uniform float against 0.9
+ b + rgeom(n if= (runif(1), >prob = 0.9)
f(a, b + 1)
else
a + b
}