**commit** fe03eca6d297aed17f84e5f35d28c796dec6429a
**parent** f99c8574a3a063f67f6d47536d60ed85b871c807
**Author:** Agastya Chandrakant <acagastya@outlook.com>
**Date:** Mon, 16 Apr 2018 20:24:54 +0530
add
**Diffstat:**

1 file changed, 9 insertions(+), 2 deletions(-)

**diff --git a/s4/fafl/report.md b/s4/fafl/report.md**
@@ -7,7 +7,7 @@
Consider two numbers `u` and `v`. `u % v = (u - v) % v`, if `u` is greater than or equal to `v` else `u`. Using this, a recursive relation can be established, which is:
$\mod(u, v) = \begin{cases} u: u < v\\mod (u - v, v): otherwise\end{cases}$
-Its iteratie code in JavaScript is:
+Its iterative code in JavaScript is:
```
function modulo(u, v) {
@@ -28,8 +28,15 @@ function newModulo(u, v) {
return u;
}
```
-In the above code, `quo` variable gives the
+In the above code, `quo` variable gives the quotient. Noting that repeated subtraction yields remainder, and count of subtraction yields quotient, state transition diagram of a STM with infinite memory (in theory) can be drawn.
+
+__Refer figure for TM1 which acts as a transducer to find remainder and quotient of two natural numbers__
### STM to check if entered natural number is prime or not
Consider a natural number `num`. If it is a composite number, it has atleast one factor between two and $\frac{num}{2}$
+
+### Source code
+```
+// to be added tomorrow
+```