# How to calculate likelihood to succeed knowing attempts and successful attempts amounts?

Say I have two algorithms that I don't know how they work but I know what they are meant to achieve. I tried algorithm A once and it succeeded. And tried algorithm B 100 times and succeeded 99 times. So A succeeded 100% times and B succeeded 99% times, but my common sense tells me B is still more "reliable" than A. How can I express this mathematically, or, how can I calculate which algorithm should I choose if I have to choose one when all I know about each of them is how many times it has been tested and how many times it succeeded (if it didn't that just means it failed for what I need)?

Please be as simple as possible I'm a newbie at math.

-
Wouldn't (SuccessfulAttempts - 1) / Tries be a good approximation? –  Juan Dec 13 '10 at 9:15
${\rm SuccessfulAttempts}/{\rm Tries}$ is a good approximation provided that ${\rm Tries}$ is sufficiently large. –  Shai Covo Dec 14 '10 at 17:12
I do the -1 so that cases with small Tries don't get a very high number, so that, for example, 1 / 1 doesn't get 100% –  Juan Dec 14 '10 at 17:17