Skip to content

Commit 1dc0f13

Browse files
authored
Update appendix-b.md
1 parent 2893b74 commit 1dc0f13

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

discrete-maths/appendix-b.md

+8-14
Original file line numberDiff line numberDiff line change
@@ -48,25 +48,19 @@ $$Thence, f(N) = N_c = C(N) * (N_{c_b} + N_{\phi})$$ ;where $C(N)$ is the comple
4848

4949
$$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.
5050

51-
### 3) Second-order loops - Closures analysis:
51+
### 3) Second-order loops - Closures insider analysis:
5252
- Base idea: Find the $N_{c_b}$ and back-substitute it.
5353
- Recall, _Closure C_:
5454
```java
5555
FOR K = 1 THRU N
56-
// execute commands (conditions - statements - operations - compound closures)
56+
IF (MAT[J,K] = 1 and MAT[I,K] = 1) THEN
57+
command()
58+
END
59+
command()
5760
END
5861
```
59-
- Hence, it will execute by $f(n)=N$ number of times, depending on the iteration number $N$.
60-
- Then, $N_{c_b} = f(N) = N$.
61-
- Back-substitution, $N_c = N^2 * (N_{c_b} + N_{\phi}) = N^2 * (N + N_{\phi})$
62+
$$Since, f(N) = C(N) * \sum_{n=1}^N N_c$$
63+
- Then, $f(N) = N_c = N * (N_{c_c} + N_{\phi})$.
64+
- Back-substitution yields: $$N_c = N^2 * (N_{c_b} + N_{\phi}) = N^2 * (N_c + N_{\phi}) = N^2 * (N * (N_{c_c} + N''\_{\phi}) + N'\_{\phi}) = N^3 * (N_{c_c} + N''\_{\phi}) + N^2 * N'\_{\phi}$$
6265

63-
### 4) Second-order loops - An Insider look:
64-
- Base idea: Again, as _(2)_, apply the _additive identities_ on the previous quadratic transcendental function.
65-
- Recall, _Closure D_:
66-
```java
67-
IF (MAT[J,K] = 1 and MAT[I,K] = 1) THEN
68-
// execute commands (conditions - statements - operations - compound closures)
69-
END
70-
```
71-
- Then, the following applies $$N_{e^{''}} = N_{P^{'}} + N_{\phi}^{'}$$ ;where $N_{e^{''}}$ represents the discrete compound complexity for _Closure C_ and _Closure D_ ONLY, when taken out of this system.
7266

0 commit comments

Comments
 (0)