Mathematics I

"Houses useful re-usable formulas, which create the base for life management, electrical engineering, medicine, and computer science."

Discrete Mathematics I: Appendix-C: Analysis by example

Test for transitivity of relations in set A, where R represents the set of the relations from A to A; such that {A R A} can be deployed:

1. RESULT ← T
2. FOR I = 1 THRU N
  a. FOR J = 1 THRU N
    1. IF (MAT[I,J] = 1) THEN
      a. FOR K = 1 THRU N
        1. IF (MAT[J,K] = 1 and MAT[I,K] = 1) THEN
          a. RESULT ← F

### 1) Main loops - Closures analysis:

2) Main loops - An Insider look:

\[f(N) = C(N) * \sum_{c=1}^C N_c = C(N) * (N_{0} + N_{1} + ... + N_{C-1} + N_{C})\]

\(Thence, f(N) = N_c = C(N) * (N_{c_b} + N_{\phi})\) ;where $C(N)$ is the complexity of the superclosure (aka. closure-A), $N_{c_b}$ is the complexity of subclosure (aka. clousre-B), and $N_{\phi}$ resembles the rest of the clock-complexity outside the subclosure B (i.e., the complexity of the commands outside the clousre-B, but inside closure-A.

\(Thence, f(N) = N_c = N^2 * (N_{c_b} + N_{\phi})\) ;where $f(N)$ represents the total complexity of the execution of closure-B in the previous snippet, $C(N)$ represents the clock-complexity of the superclosure (i.e., closure-A), and $N_{c_b}$ resembles the clock-complexity (aka. number of times of execution) of the subclosure (i.e., closure-B), and $N_{\phi}$ resembles the clock-complexity of the other commands inside the superclosure A, but outside the subclosure B. Now, the next step is to find the $N_{c_b}$ and back-substitute it into this equation.

3) Second-order loops - Closures insider analysis: