Difference between revisions of "TADM2E 3.28"
From Algorithm Wiki
(Recovering wiki) |
(Recovering wiki) |
||
Line 1: | Line 1: | ||
We need two pass over X: | We need two pass over X: | ||
− | 1. Calculate cumulative production P and Q: | + | 1. Calculate cumulative production P and Q:<br> |
− | + | <math>P_0 = 1, P_k=X_k P_{k-1}=\prod_{i=1}^kx_i</math><br> | |
− | + | <math>Q_n = 1, Q_k=X_k Q_{k+1}=\prod_{i=k}^nx_i</math> | |
− | 2. Calculate M: | + | 2. Calculate M:<br> |
− | + | <math>M_k=P_{k-1}Q_{k+1}, k\in[1,n]</math> |
Revision as of 18:22, 11 September 2014
We need two pass over X:
1. Calculate cumulative production P and Q:
$ P_0 = 1, P_k=X_k P_{k-1}=\prod_{i=1}^kx_i $
$ Q_n = 1, Q_k=X_k Q_{k+1}=\prod_{i=k}^nx_i $
2. Calculate M:
$ M_k=P_{k-1}Q_{k+1}, k\in[1,n] $