Example 3.2       m=n!   p.32

n = 10;

m = 1;
If[n > 1, 
        Do[ m = 
            m i 
                          , {i, 2, n}]
];
m

Example 3.3        Max  search of set    p.33

t = {5, 7, 4, 10, 6, 2, 100, 9, 0, 5, 3, 8}
n = Length[t];

tmax = t[[1]];
Do[If[tmax < t[[i]], tmax = t[[i]]]
, {i, 1, 
        n}]
Print["max=", tmax]

Max[t]

Example 3.4    Standard sort  of set  p.34

tin = {5, 7, 4, 10, 6, 2, 1, 9, 0, 5, 3, 8, 
          3};
n = Length[tin];

Print["in  t=", t = tin]
\(Do[
	
      Do[\ \ If[
          t[\([i]\)] > t[\([i + 1]\)], {w = t[\([i]\)], 
            t[\([i]\)] = t[\([i + 1]\)]\ , 
            t[\([i + 1]\)] = w}]
\ \ \ \ , {i, 
          n - 1}]
, {n - 1}]\)
Print["out t=", t]

Print["out t=", Sort[tin]]

Example 3.5    Decending sort of set  p.35

Mysort[t0_] := 
      Module[  {t = t0, n} , 
        n = Length[t]; 
Do[
          Do[  If[
              t[[i]] < t[[i + 1]], {w = t[[i]], 
                t[[i]] = t[[i + 1]], 
                t[[i + 1]] = w}]
    , {i, 
              n - 1}], {n - 
              1}]                                                         ; 
        t  ]
Print["in  t=", tin]
Print["out t=", Mysort[tin]]

Print["out t=", Sort[tin, Greater]]

Example 3.6   Matrix multiplication,  c[n,m]=a[n,n1] b[n1,m]  p.36

a = {{a11, a12, a13}, {a21, a22, a23}};
b = {{b11, b12}, {b21, b22}, {b31, 
            b32}};
n = Length[a];
n1 = Length[a[[1]]];
m = Length[b[[1]]];

c = Table[0, {i, n}, {j, m}];

Do[Do[{  d = 0; 
          Do[d = d + a[[i, k]] b[[k, j]] , {k, 1, n1}]; 
          c[[i, j]] = d}
 , {j, 1, m}], {i, 1, 
        n}]
Print["c=", MatrixForm[c]]

c - a . b

Example 3.7   Cyclic matrix formulation  p.37

a = {a1, a2, a3, a4, a5, a6}
n = Length[a];

m = IdentityMatrix[n];

Do[
      Do[{k = i + j - 1, If[k <= n , , k = k - n ], 
          m[[i, k]] = a[[j]]}
, {j, 1, n}], {i, 1, 
        n}]

    
Print["m=", MatrixForm[m]]