0

I have three types of measurements that will conditionally increment an X value given that the initial X value is zero. The three measurements are: E = e-value I = Percent Identity A = Alignment length

The condition is:

If E lower or equal than 3 AND I higher or equal than 90% AND A higher or equal than 35; X is added 1. X can reach any number of total observations in a database of T individuals.

I have limited knowledge about mathematical symbols but with this I will have an idea of how to proceed with the next interpretations.

Thank you

andresito
  • 103

1 Answers1

0

One might translate it as $$ (E \le 3) \wedge (I \ge 90 \%) \wedge(A \ge 35) \Rightarrow X := X + 1 $$ using the usual order relations $\le$ and $\ge$ and the logical conjunction $\wedge$ and implication $\Rightarrow$.

The fishy bit is the increment of $X$, as in mathematics, variables once bound to a value, keep that value, the $:=$ is not an equal but an (re-)assignment, as used in computer science.

Example in a pseudocode:

if (E <= 3) and (I >= 90) and (A >= 35) do
  X := X + count(db, T)
end
mvw
  • 34,562
  • Thank you very much for your response @mvw, it is really helpful. Is there a possibility of putting X in a summation symbol (sigma) instead of X:=X+1? I'm thinking this since I might add as many 1s to the X variable as T individuals in the database. Thank you again! – andresito Feb 29 '16 at 19:51
  • You can describe computer programs mathematically, have a look on a book on theoretical computer science, but usually one sticks to pseudo code, which resembles a real programming language, but is less detailed / more abstract. I will add an example. – mvw Mar 01 '16 at 01:50