-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAlgorithms in C#.tex
132 lines (98 loc) · 3.37 KB
/
Algorithms in C#.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
\documentclass[11pt,a4paper]{book}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\author{Artem Los}
\usepackage{marginnote}
\usepackage{verbatim} % for the box
\usepackage{fancyvrb} % for the box
\usepackage{listings}
\lstset{language=C,
numberstyle=\footnotesize,
basicstyle=\ttfamily\footnotesize,
numbers=left,
rulesepcolor=\color{gray}, %fancy shadow for borders
stepnumber=1,
frame=shadowbox,
breaklines=true}
\usepackage{pgf}
\usepackage{pgfpages}
\usepackage{cite}
\usepackage{url}
% GOAL OF THE BOOK IS TO
% - TEACH SELF TAUGHT PEOPE ABOUT ALGORITHMS AND
% - WITH HEAVY FOCUS ON YOUTH YEAR 9-12
% - PROMOTION OF COMPUTER SCIENCE
%
% include Math exploration + computer code
% include a description of the pattern based key validation.
% alg. via C# booket + an intro to how to start with c# and JS
% how can people start applying mod arithmetic to solve real 3^1233 problems, etc.
% http://people.uncw.edu/norris/133/proofs/quotientremaindertheorem.htm
%residue number system
% define Z (integer) notation
\usepackage{titlesec, blindtext, color}
\definecolor{gray75}{gray}{0.75}
\newcommand{\hsp}{\hspace{20pt}}
\titleformat{\chapter}[hang]{\Huge\bfseries}{\thechapter\hsp\textcolor{gray75}{$|$}\hsp}{0pt}{\Huge\bfseries}
\newcommand\clock[4][2]{%
\begin{tikzpicture}[scale=#1,line cap=round,line width=#1*3pt]
\filldraw [fill=white!20] (0,0) circle (2cm);
\foreach \angle / \label in
{0/3, 30/2, 60/1, 90/12, 120/11, 150/10, 180/9,
210/8, 240/7, 270/6, 300/5, 330/4}
{
\draw[line width=#1*1pt] (\angle:1.8cm) -- (\angle:2cm);
\draw (\angle:1.4cm) node[scale=#1]{\textsf{\label}};
}
\foreach \angle in {0,90,180,270}
\draw[line width=#1*2pt] (\angle:1.6cm) -- (\angle:2cm);
\draw[rotate=90,line width=#1*2pt] (0,0) -- (-#2*30-#3*30/60:0.7cm); % hours
\draw[rotate=90,line width=#1*1.5pt] (0,0) -- (-#3*6:1cm); % minutes
\draw[rotate=90,line width=#1*.6pt,red] (0,0) -- (-#4*6:1.2cm); % seconds
\path [fill=black] (0,0) circle (3pt);
\path [fill=red] (0,0) circle (1.5pt);
%
\end{tikzpicture}%
}
\newcommand\clockA[4][2]{%
\begin{tikzpicture}[scale=#1,line cap=round,line width=#1*3pt]
\filldraw [fill=white!20] (0,0) circle (2cm);
\foreach \angle / \label in
{0/3, 30/2, 60/1, 90/0, 120/c-1, 150/c-2, 180/\quad c-3,
210/\dots, 240/\dots, 270/\dots, 300/5, 330/4}
{
\draw[line width=#1*1pt] (\angle:1.8cm) -- (\angle:2cm);
\draw (\angle:1.4cm) node[scale=#1]{\textsf{\label}};
}
\foreach \angle in {0,90,180,270}
\draw[line width=#1*2pt] (\angle:1.6cm) -- (\angle:2cm);
\draw[rotate=90,line width=#1*2pt] (0,0) -- (-#2*30-#3*30/60:0.7cm); % hours
\draw[rotate=90,line width=#1*1.5pt] (0,0) -- (-#3*6:1cm); % minutes
\draw[rotate=90,line width=#1*.6pt,red] (0,0) -- (-#4*6:1.2cm); % seconds
\path [fill=black] (0,0) circle (3pt);
\path [fill=red] (0,0) circle (1.5pt);
%
\end{tikzpicture}%
}
\usepackage{tikz}
\usepgflibrary{shapes}
\usepackage{makeidx}
\begin{document}
% for modulus and encyrption: https://www.khanacademy.org/computing/computer-science/cryptography/modarithmetic/a/the-euclidean-algorithm
%remember to include it later.
%\include{Chapter1-NumeralSystems}
\include{Chapter2-ModularArithmetic}
\cite{From2To16}
\cite{Concrete}
\cite{Pelerman1}
\cite{Khan1}
\cite{TrickBook}
% floor of x/2 + ceiling of x/2 = x%
%\mbox{}
\bibliographystyle{amsplain}
\bibliography{bibfileCshharp}
\bibliographystyle{amsplain}
\end{document}