Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Assuming each node has a constant, known and independent availability rate, A divide and conquer approach come to mind.</p> <p>Say you have <code>N</code> nodes.</p> <ol> <li>Split them into two sets of <code>N/2</code> nodes.</li> <li>For each side, compute the probability that any number of nodes (<code>[0,N/2]</code>) are down.</li> <li>Multiply and sum these as needed to find the probability that any number (<code>[0,N]</code>) of the full set is down.</li> </ol> <p>Step 2 can be done recursively and at the top level you can sum as need to find how often more than some number are down.</p> <p>I don't know the complexity of this but if I has to guess, I'd say at or below <code>O(n^2 log n)</code></p> <hr> <p>The mechanics of this can be illustrated on a terminal case. Say we have 5 nodes with up times <img src="https://chart.apis.google.com/chart?cht=tx&amp;chl=p_1...p_5" alt="p1...p5">. We can split this into segments <code>A</code> with<img src="https://chart.apis.google.com/chart?cht=tx&amp;chl=p_1...p_2" alt="p1...p2"> and <code>B</code> with <img src="https://chart.apis.google.com/chart?cht=tx&amp;chl=p_2...p_6" alt="p3...p5">. We then can process these to find the "N nodes up" times for each segment:</p> <p>For A:</p> <p><img src="https://chart.apis.google.com/chart?cht=tx&amp;chl=a_2=p_1p_2" alt="a_2"></p> <p><img src="https://chart.apis.google.com/chart?cht=tx&amp;chl=a_1=p_1(1-p_2)%2b(1-p_1)p_2" alt="a_1"></p> <p><img src="https://chart.apis.google.com/chart?cht=tx&amp;chl=a_0=%281-p_1)%281-p_2)" alt="a_0"></p> <p>For B:</p> <p><img src="https://chart.apis.google.com/chart?cht=tx&amp;chl=b_2=p_3p_4p_5" alt="b_3"></p> <p><img src="https://chart.apis.google.com/chart?cht=tx&amp;chl=b_2..b_0" alt="b_2"></p> <p>The final results for this stage can be found by multiplying each of the <code>a</code>'s with each of the <code>b</code>'s and summing appropriately.</p> <pre><code>v[0] = a[0]*b[0] v[1] = a[1]*b[0] + a[0]*b[1] v[2] = a[2]*b[0] + a[1]*b[1] + a[0]*b[2] v[3] = a[2]*b[1] + a[1]*b[2] + a[0]*b[3] v[4] = a[2]*b[2] + a[1]*b[3] v[5] = a[2]*b[3] </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload