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; } 
  • 1
    I don't get it. Please be more specific!2012-02-03
  • 0
    I'm sorry @draks, I thought that was extremely specific. I'll write the algorithm out in C#.2012-02-04
  • 0
    But what is the question?2012-02-04
  • 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
    Just one question... is cartesian product correct? Isn't this simply product (k=1)?2012-02-04
  • 0
    $\prod\limits_{i=1}^n x_i$ stands for $x_1\cdot x_2\cdot\ldots\cdot x_n$2012-02-04
  • 0
    Oh, I was going off Wikipedia's page http://en.wikipedia.org/wiki/Math_symbols which states i= is cartesian product and k= is product... unless I am misreading it?2012-02-04
  • 0
    Most of mathematical symbols have overloaded with their meanings. $\prod\limits_{i=1}^n$ stands for usual product of numbers, and for cartesian product also2012-02-04
  • 0
    Ok. But to be safe, I could simply substitute k.2012-02-04
  • 0
    How does one then know if product or cartesian product is indicated?2012-02-04
  • 1
    Oh, finally I got what you meant! The meaning of $\prod\limits_{i=1}^n$ and $\prod\limits_{k=1}^n$ is the same. The letter used under symbol $\prod$ is called index. We can use any letter to denote index. Distinguishing product of numbers and cartesian product relies on the context of mathematical text. You must have some math background to easly determine meaning from context.2012-02-04
  • 0
    Ok, now it makes sense! Thanks for explaining it to me.2012-02-04