Edited 12_path_finding.asciidoc with Atlas code editor

pull/910/head
kristen@oreilly.com 3 years ago
parent f9d6dadaf9
commit cefe65a00e

@ -241,9 +241,12 @@ First, let's posit that a channel with capacity +c+ has liquidity on one side wi
More simply, if the possible values for the liquidity are 0, 1, 2, 3, 4, and 5, only one of those six possible values will be sufficient to send our payment. To continue this example, if our payment amount was 3, then we would succeed if the liquidity was 3, 4, or 5. So our chances of success are 3 in 6 (50%). Expressed in math, the success probability function for a single channel is:
latexmath:[$P_c(a) = (c + 1 - a) / (c + 1)$]
[latexmath]
++++
$P_c(a) = (c + 1 - a) / (c + 1)$
++++
where +a+ is the amount and +c+ is the capacity
where _a_ is the amount and _c_ is the capacity.
From the equation we see that if the amount is close to 0, the probability is close to 1, whereas if the amount exceeds the capacity, the probability is zero.
@ -253,9 +256,12 @@ Now let's think about the probability of success across a path made of several c
We can express this as an equation that calculates the probability of a payment's success as the product of probabilities for each channel in the path(s):
latexmath:[$P_{payment} = \prod_{i=1}^n P_i$]
[latexmath]
++++
$P_{payment} = \prod_{i=1}^n P_i$
++++
Where P~__i__~ is the probability of success over one path or channel, and P~__payment__~ is the overall probability of a successful payment over all the paths/channels.
Where __P__~__i__~ is the probability of success over one path or channel, and __P__~__payment__~ is the overall probability of a successful payment over all the paths/channels.
From the equation we see that since the probability of success over a single channel is always less than or equal to 1, the probability across many channels will _drop exponentially_.

Loading…
Cancel
Save