lightning community – Tips on how to compute the anticipated variety of sats to reach in a probabilistic cost movement?

on

|

views

and

comments


Take a look at the next community instance:

enter image description here

Assume S desires to ship 3 sats to R. You’ll be able to additional assume that S has sufficient liquidity in every of its native channels to ship as much as 3 sats. Additionally assume the liquidity in channels (A,R), (B,R) and (C,R) is uniformly distributed.

one optimally dependable cost movement on this diagram appears to be like like this:

1 sat: S --> A --> R   chance: 2/3
2 sats: S --> B --> R  chance: 3/5

This movement has a complete chance of 2/3*3/5 = 2/5 = 0.4 = 40%

The query:

Tips on how to compute the anticipated worth of Satoshis to reach at R if S sends 3?

Possibility A

(which I already know is unsuitable however I write it down as a result of I think some individuals may need an analogous first thought)

Initially I believed this could simply be 3 sats * 2/5 = 6/5 sats = 1.2 sats which is what one will get from multiplying the quantity to ship with the chance of the movement. This appears unusual as sending 2 sats alongside S-->B-->R has a chance of 3/5 and with the reasoning of above an expectation worth of 2 sats * 3/5 = 6/5 sats = 1.2 sats. because the anticipated worth for 1 sat alongside the S-->A-->B path is bigger than 0 this could be a contradiction to the additivity of the anticipated worth.

Possibility B

Ranging from the above reasoning we add the anticipated values for the disjoint paths so:

E[3 sats] = 1 sat * 2/3 + 2 sat * 3/5 = 10/15 sats + 18/15 sats = 28/15 sats

Possibility C

In fact the two satoshi path S-->B-->R doesn’t should be despatched as one onion however might be despatched as two onions with 1 sat every:

The primary has a chance of 4/5 and the second has a conditional chance of 3/4 which is extensively defined at this challenge. With the logic from choice B one ought to have the ability to add these anticipated values.
so we have now the anticipated worth for sending two sats in two seperate 1 sat onions alongside S--> B --> R can be computed as:

E[2 sats] = 1 sat * 4/5 + 1 sat * 3/4 = 31/20 sats 

If we add the 1 sat onion from the S-->A-->R which was 2/3 sats

we might count on to have

E[3 sats] = 31/20 sats + 2/3 sats = 93/60 sats + 40/60 sats = 132/60 sats = 33/15 sats

That is 5/15 sats = 1/3 sats greater than the reply in choice B

Possibility D

To make issues worse I’m confused if the anticipated values of dissecting the two sat onion in choice C into two 1 sat onions can simply linearly added up because the second onion is conditioned on having 2 sats of liquidity within the channel. If the primary onion has failed the second will definitely fail. Thus one must compute anticipated worth for sending two 1 sat onions like this:

E[2 sats] = 1 sat * 4/5 + 1 sat * 3/5 = 7/5 sats

this could lead to a complete anticipated worth of:

E[3 sats] = 2/3 sats + 7/5 sats = 10/30 sats + 21/15 sats = 31/15 sats

Ideas

only for comparability listed below are the outcomes

  • Possibility A: 18/15
  • Possibility B: 28/15
  • Possibility C: 33/15
  • Possibility D: 31/15

Whereas Possibility B appears definitely proper it is sensible to additional dissect the two sats onion. In simulations I did plainly Possibility D is right which is a bit stunning for me. Utilizing the formalism of chance principle the distinction for the two sat path is:

  • Possibility C: E[2 sats] = 1 sat * P(X>=1) + 1 sat * P(X>=2 | X >= 1)
  • Possibility D: E[2 sats] = 1 sat * P(X>=1) + 1 sat * P(X>=2)

As mentioned the simulated setting signifies that Possibility D is the right reply however that’s extremely stunning to me as I might count on the second time period to be a conditional probabilty.

Share this
Tags

Must-read

Self-driving taxis are coming to London – ought to we be anxious? | Jack Stilgoe

At the top of the nineteenth century, the world’s main cities had an issue. The streets had been flooded with manure, the unintended...

US regulators open inquiry into Waymo self-driving automobile that struck youngster in California | Expertise

The US’s federal transportation regulator stated Thursday it had opened an investigation after a Waymo self-driving car struck a toddler close to an...

US robotaxis bear coaching for London’s quirks earlier than deliberate rollout this yr | London

American robotaxis as a consequence of be unleashed on London’s streets earlier than the tip of the yr have been quietly present process...

Recent articles

More like this

LEAVE A REPLY

Please enter your comment!
Please enter your name here