1
$\begingroup$

I need to know how to represent the following as a mathematical formula using proper math notation:

I have a $1\times n$-matrix of $3$-tuples $[a, r, x]$. I need to represent the following logic mathematically:

for each element in the matrix set $x = a r-a+1$ then $X = x_0 \cdot x_1\cdot\ldots\cdot x_n$ $A = \operatorname{average}(a_0,\ldots,a_n)$ $Z = X \cdot A$

In C#:

struct Element {     public double a;     public double r;     public double x; }  private void button15_Click(object sender, EventArgs e) {     // define the matrix     Element[] matrix = new Element[3];     Element elem;      // populate the matrix with something     matrix[0] = new Element { a = 1, r = 0.9 };     matrix[1] = new Element { a = 0.75, r = 0.2 };     matrix[2] = new Element { a = 1, r = 1 };      // for each element, calculate x     for (int i = 0; i < matrix.Length; i++)     {         elem = matrix[i];         elem.x = elem.a * elem.r - elem.a + 1;     }      // determine X and A     elem = matrix[0];     double X = elem.x;     double A = elem.a;      // calculate for each element, starting at 1     for (int i = 1; i < matrix.Length; i++)     {         elem = matrix[i];         X *= elem.x;         A += elem.a;     }      A /= matrix.Length;     // X is equal to matrix[0].x * matrix[1].x * matrix[2].x     // A is equal to Average(matrix[0].a, matrix[1].r, matrix[2].r)     double Z = X * A; } 
  • 0
    How do I represent this as a math formula.2012-02-04

1 Answers 1

2

Here are they $ X=\prod\limits_{i=0}^nx_i=\prod\limits_{i=0}^n(a_i r_i-a_i+1)\qquad\qquad A=\frac{1}{n+1}\sum\limits_{i=0}^n a_i $ $ Z=X\cdot A=\left(\prod\limits_{i=0}^n(a_i r_i-a_i+1)\right)\left(\frac{1}{n+1}\sum\limits_{i=0}^n a_i\right) $

  • 0
    Ok, now it makes sense! Thanks for explaining it to me.2012-02-04