Difference between revisions of "TADM2E 3.28"

From Algorithm Wiki
Jump to: navigation, search
(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:<br>
+
1. Calculate cumulative production P and Q:<br>
&lt;math&gt;P_0 = 1, P_k=X_k P_{k-1}=\prod_{i=1}^kx_i&lt;/math&gt;&lt;br&gt;
+
<math>P_0 = 1, P_k=X_k P_{k-1}=\prod_{i=1}^kx_i</math><br>
&lt;math&gt;Q_n = 1, Q_k=X_k Q_{k+1}=\prod_{i=k}^nx_i&lt;/math&gt;
+
<math>Q_n = 1, Q_k=X_k Q_{k+1}=\prod_{i=k}^nx_i</math>
  
2. Calculate M:&lt;br&gt;
+
2. Calculate M:<br>
&lt;math&gt;M_k=P_{k-1}Q_{k+1}, k\in[1,n]&lt;/math&gt;
+
<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] $