text:
\documentclass[11pt,a4paper]{scrartcl}
\usepackage{gram}
\usetikzlibrary{arrows}
\usetikzlibrary{patterns}
\usepackage{svg}
\usepackage{pgfplots}
\pgfplotsset{compat=1.15}
\usetikzlibrary{arrows}
\pagecolor{fizikawhite}

\title{FIZIKA-2021 Round-1}
\author{FIZIKA Committee}
\date{August 2021}

\begin{document}

\maketitle

\vspace{8mm}
\section{Problem 1}
%% INSP Pr 1
\begin{solution}
Magnetic field due to a hollow cylinder will be zero at all interior points and for exterior points hollow cylinder will behave like a wire at the axis. Therefore for the outermost shell at infinity will experience pressure factor of $4$ and due to its own current it will experience a factor of $8$ in pressure expression. Therefore net pressure must be zero in order to make the outermost shell stress free.
$$\frac{\mu_{0} I_{0} I_{\infty}}{4\pi^2 R_{\infty}^2}+\frac{\mu_{0} \left(\frac{I_{0}}{2}\right) I_{\infty}}{4\pi^2 R_{\infty}^2}+\frac{\mu_{0} \left(\frac{I_{0}}{4}\right) I_{\infty}}{4\pi^2 R_{\infty}^2}+\cdots= \frac{\mu_{0} I_{\infty}}{8\pi^2 R_{\infty}^2}$$
$$\mu_{0} I_{0} I_{\infty} \left(1+\frac{1}{2}+\frac{1}{4}+\cdots+\infty\right)=\frac{\mu_{0} I_{\infty}^2}{2}$$
This is a geometric progression with first term 1 and common ratio $1/2$, hence we can write
$$I_{0} \left(\frac{1}{1-\frac{1}{2}}\right)=\frac{I_\infty}{2}$$
$$2I_0 = \frac{I_\infty}{2}$$
$$\boxed{\frac{I_\infty}{I_0}=4}$$
\end{solution}

\section{Problem 2}
\begin{solution}
When $h>1m>x$:\\
We get $$F= mg- v\frac{dm}{dt}$$
$$a= g- \frac{v}{m}\frac{dm}{dt}$$
\begin{equation}
\label{eqn:1}
v \frac{dv}{dx} = g- v\frac{\frac{dm}{dt}}{m}
\end{equation}

Now, Using $\lambda(x)=x$, $$dm = x dx$$
Integrating:
$$m = \frac{x^2}{2}$$
Now substituting in (\ref{eqn:1}), we get:
\end{solution}
\section{Problem 3}
\begin{solution}
Answer: $AC$

Divide the lower rhombus into two equilateral triangles. Let the mutual inductance of a pair of an equilateral triangle having a side (adjacent ones) be '$M_{adj}$' and the ones away be '$M_{away}$'. We need to solve for $M_{adj}+M_{away}$. Dimension analysis helps us realise a triangle of twice the side length has '$2L$' inductance. Taking this as a hint to solve the problem further, we build an extra triangle to the above figure to make it a '$2l$' side equilateral triangle (see the equivalence). \\
\begin{center}

\tikzset{every picture/.style={line width=0.75pt}} %set default line width to 0.75pt

\begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-1,xscale=1]
%uncomment if require: \path (0,300); %set diagram left start at 0, and has height of 300

%Shape: Triangle [id:dp45070517116788844]
\draw   (204,115) -- (252.5,205) -- (155.5,205) -- cycle ;
%Shape: Triangle [id:dp9654711726051111]
\draw   (252.5,205) -- (204,115) -- (301,115) -- cycle ;
%Shape: Triangle [id:dp9637996023047706]
\draw   (255,16) -- (303.5,106) -- (206.5,106) -- cycle ;
%Shape: Arc [id:dp9006265533237994]
\draw  [draw opacity=0] (184.51,121.1) .. controls (174.44,117.06) and (169.14,105.83) .. (172.59,95.4) .. controls (176.19,84.55) and (187.89,78.68) .. (198.74,82.27) .. controls (198.94,82.34) and (199.14,82.41) .. (199.33,82.48) -- (192.23,101.91) -- cycle ; \draw   (184.51,121.1) .. controls (174.44,117.06) and (169.14,105.83) .. (172.59,95.4) .. controls (176.19,84.55) and (187.89,78.68) .. (198.74,82.27) .. controls (198.94,82.34) and (199.14,82.41) .. (199.33,82.48) ;
%Shape: Arc [id:dp2536457345650631]
\draw  [draw opacity=0] (268.81,192.27) .. controls (275.49,200.81) and (274.45,213.19) .. (266.22,220.48) .. controls (257.67,228.06) and (244.6,227.27) .. (237.02,218.72) .. controls (236.88,218.57) and (236.74,218.41) .. (236.61,218.25) -- (252.5,205) -- cycle ; \draw   (268.81,192.27) .. controls (275.49,200.81) and (274.45,213.19) .. (266.22,220.48) .. controls (257.67,228.06) and (244.6,227.27) .. (237.02,218.72) .. controls (236.88,218.57) and (236.74,218.41) .. (236.61,218.25) ;
%Shape: Arc [id:dp36041828783112884]
\draw  [draw opacity=0] (315.92,94.13) .. controls (325.86,97.02) and (331.97,107.19) .. (329.67,117.44) .. controls (327.28,128.08) and (316.71,134.78) .. (306.06,132.39) .. controls (305.87,132.34) and (305.67,132.3) .. (305.48,132.25) -- (310.39,113.11) -- cycle ; \draw   (315.92,94.13) .. controls (325.86,97.02) and (331.97,107.19) .. (329.67,117.44) .. controls (327.28,128.08) and (316.71,134.78) .. (306.06,132.39) .. controls (305.87,132.34) and (305.67,132.3) .. (305.48,132.25) ;
%Straight Lines [id:da6217402842023374]
\draw    (199.33,82.48) -- (206.23,85.35) ;
\draw [shift={(209,86.5)}, rotate = 202.57999999999998] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;
%Straight Lines [id:da29960175466769323]
\draw    (184.51,121.1) -- (191.4,123.97) ;
\draw [shift={(194.17,125.12)}, rotate = 202.57999999999998] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;
%Straight Lines [id:da8778978516616684]
\draw    (315.92,94.13) -- (308.9,92.27) ;
\draw [shift={(306,91.5)}, rotate = 374.88] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;
%Straight Lines [id:da13467515008002184]
\draw    (305.48,132.25) -- (299.93,128.92) ;
\draw [shift={(297.36,127.38)}, rotate = 390.95] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;
%Straight Lines [id:da28728369632594175]
\draw    (270.48,194.25) -- (264.93,190.92) ;
\draw [shift={(262.36,189.38)}, rotate = 390.95] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;
%Straight Lines [id:da011947815826994335]
\draw    (236.61,218.25) -- (233.98,215.25) ;
\draw [shift={(232,213)}, rotate = 408.7] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;

% Text Node
\draw (156,56.9) node [anchor=north west][inner sep=0.75pt]    {$M_{away}$};
% Text Node
\draw (258,226.9) node [anchor=north west][inner sep=0.75pt]    {$M_{adj}$};
% Text Node
\draw (333,113.9) node [anchor=north west][inner sep=0.75pt]    {$M_{adj}$};

\end{tikzpicture}

\end{center}
Each small traingle 'Labelled-$1$' haws one self flux term $L_{i}$, one self flux term $L_{i}$, one $M_{adj}*i$ term, two $M_{away}*i$ terms. Labelled-$2$ triangle has one $L_{i}$, three  $M_{adj}*i$ terms. So, counting properly, \\
$$4L_{i}+6M_{adj}*i+6M_{away}*i= 2L_i$$
$$\Rightarrow |M_{adj}+M_{away}|= \frac{L}{3}$$

\begin{center}

\tikzset{every picture/.style={line width=0.75pt}} %set default line width to 0.75pt

\begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-1,xscale=1]
%uncomment if require: \path (0,300); %set diagram left start at 0, and has height of 300

%Shape: Triangle [id:dp40692481476808906]
\draw   (144.32,20) -- (196.65,111) -- (92,111) -- cycle ;
%Shape: Triangle [id:dp6062532337301327]
\draw   (144.32,207) -- (92,116) -- (196.65,116) -- cycle ;
%Shape: Triangle [id:dp3087361734769454]
\draw   (200.65,119) -- (252.97,210) -- (148.32,210) -- cycle ;
%Shape: Triangle [id:dp4678656626426605]
\draw   (87,119) -- (139.32,210) -- (34.68,210) -- cycle ;
%Straight Lines [id:da6851226797651961]
\draw    (109,65) -- (124,56) -- (122,73) ;
%Straight Lines [id:da737765955033743]
\draw    (49.8,167.8) -- (64.8,158.8) -- (62.8,175.8) ;
%Straight Lines [id:da8709391119480012]
\draw    (126.8,111.2) -- (142.4,116) -- (126.8,120.8) ;
%Straight Lines [id:da1852761866859176]
\draw    (166.8,105.6) -- (149.2,111.2) -- (165.6,115.6) ;
%Straight Lines [id:da30638262627497226]
\draw    (229.2,154) -- (229.6,169.6) -- (214.8,161.2) ;

%Straight Lines [id:da8883030152871985]
\draw    (277,108) -- (331,108) ;
%Straight Lines [id:da7208774874755355]
\draw    (278,119) -- (332,119) ;
%Straight Lines [id:da6249118764365742]
\draw    (278,129) -- (332,129) ;

%Shape: Triangle [id:dp03854775186272685]
\draw   (438.33,20) -- (547.65,210.13) -- (329,210.13) -- cycle ;
%Straight Lines [id:da15276694786846567]
\draw    (371.8,118.8) -- (386.8,109.8) -- (384.8,126.8) ;

% Text Node
\draw (139.4,72.4) node [anchor=north west][inner sep=0.75pt]    {$1$};
% Text Node
\draw (81.8,172.8) node [anchor=north west][inner sep=0.75pt]    {$1$};
% Text Node
\draw (198.2,173.6) node [anchor=north west][inner sep=0.75pt]    {$1$};
% Text Node
\draw (138.2,140.8) node [anchor=north west][inner sep=0.75pt]    {$2$};
% Text Node
\draw (547,97.4) node [anchor=north west][inner sep=0.75pt]  [font=\Huge]  {$=2L_i$};

% Text Node
\draw (374,79.4) node [anchor=north west][inner sep=0.75pt]  [font=\Huge]  {$i$};

\end{tikzpicture}

\end{center}
\end{solution}

\section{Problem 4}
\begin{solution}

Dimension analysis leads to $V=KR$. \newline
Each $d\theta$ sectors contributes equally.So, $dV=\frac{d\theta}{2\pi} KR$. We use this result in Figure-$2$ for sectors of variable radii given by $\frac{R}{\sqrt{2}} \sec{\theta}$, assuming square to be made of "4" right isosceles plates. So,
\[V_o = 4 \int_{\frac{-\pi}{4}}^{\frac{\pi}{4}} \frac{d\theta}{2\pi} K \left(\frac{R}{\sqrt{2}} \sec{\theta}\right)\]
\[\implies V_0 = \frac{2\sqrt{2}}{\pi} KR \int_0^{\frac{\pi}{4}}\sec{\theta} d\theta\]
\[\implies V_0 = \frac{2\sqrt{2}}{\pi} KR \ln{\left(\sqrt{2}+1\right)}\]

\end{solution}

\section{Problem 5}
\begin{solution}
%% Figure 1
\begin{center}
    \tikzset{every picture/.style={line width=0.75pt}} %set default line width to 0.75pt
\begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-1,xscale=1]
%uncomment if require: \path (0,300); %set diagram left start at 0, and has height of 300
%Straight Lines [id:da711233867243741]
\draw    (100,118) -- (257,119) ;
%Straight Lines [id:da8574720198051322]
\draw    (395,120) -- (508.99,120.73) -- (552,121) ;
%Straight Lines [id:da22926251509039042]
\draw    (255.77,118.15) -- (298.77,56.15)(258.23,119.85) -- (301.23,57.85) ;
%Straight Lines [id:da448616977028955]
\draw [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ,fill opacity=1 ]   (448.16,159.24) -- (299.16,58.24)(449.84,156.76) -- (300.84,55.76) ;
%Shape: Rectangle [id:dp9153179604750035]
\draw  [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ,fill opacity=1 ] (300,57) -- (312.25,65.15) -- (304.56,76.73) -- (292.3,68.58) -- cycle ;
%Straight Lines [id:da8887552080956109]
\draw    (260,163.02) -- (397,163.98) ;
\draw [shift={(400,164)}, rotate = 180.4] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;
\draw [shift={(257,163)}, rotate = 0.4] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;
%Straight Lines [id:da97162948128714]
\draw    (234.74,113.56) -- (281.26,48.44) ;
\draw [shift={(283,46)}, rotate = 485.54] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;
\draw [shift={(233,116)}, rotate = 305.54] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;
%Straight Lines [id:da2997316618055039]
\draw    (395.52,109.31) -- (309.48,50.69) ;
\draw [shift={(307,49)}, rotate = 394.27] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;
\draw [shift={(398,111)}, rotate = 214.27] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;
% Text Node
\draw (314,166) node [anchor=north west][inner sep=0.75pt]   [align=left] {2m};
% Text Node
\draw (223,56) node [anchor=north west][inner sep=0.75pt]   [align=left] {1m\\};
% Text Node
\draw (365,58) node [anchor=north west][inner sep=0.75pt]    {$\sqrt{3}$};
% Text Node
\draw (393,63) node [anchor=north west][inner sep=0.75pt]   [align=left] {m};
\end{tikzpicture}
\end{center}

%% Figure 2
\begin{center}

\tikzset{every picture/.style={line width=0.75pt}} %set default line width to 0.75pt

\begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-1,xscale=1]
%uncomment if require: \path (0,300); %set diagram left start at 0, and has height of 300

%Straight Lines [id:da711233867243741]
\draw    (2,143.17) -- (230.71,144.63) ;
%Straight Lines [id:da8574720198051322]
\draw    (431.74,146.08) -- (597.79,147.14) -- (660.45,147.54) ;
%Straight Lines [id:da22926251509039042]
\draw [color={rgb, 255:red, 140; green, 14; blue, 252 }  ,draw opacity=1 ][fill={rgb, 255:red, 255; green, 0; blue, 0 }  ,fill opacity=1 ]   (229.48,143.77) -- (292.12,53.45)(231.94,145.48) -- (294.58,55.16) ;
%Shape: Arc [id:dp09390960457131636]
\draw  [draw opacity=0] (231.35,146.08) .. controls (231.35,145.73) and (231.35,145.39) .. (231.35,145.04) .. controls (231.93,89.88) and (277.11,45.63) .. (332.27,46.21) .. controls (387.43,46.79) and (431.67,91.97) .. (431.1,147.13) .. controls (431.09,147.73) and (431.08,148.34) .. (431.06,148.94) -- (331.22,146.08) -- cycle ; \draw   (231.35,146.08) .. controls (231.35,145.73) and (231.35,145.39) .. (231.35,145.04) .. controls (231.93,89.88) and (277.11,45.63) .. (332.27,46.21) .. controls (387.43,46.79) and (431.67,91.97) .. (431.1,147.13) .. controls (431.09,147.73) and (431.08,148.34) .. (431.06,148.94) ;
%Straight Lines [id:da019158372781863164]
\draw [color={rgb, 255:red, 255; green, 8; blue, 8 }  ,draw opacity=1 ]   (230.71,144.63) -- (230.71,79.62) ;
\draw [shift={(230.71,77.62)}, rotate = 450] [color={rgb, 255:red, 255; green, 8; blue, 8 }  ,draw opacity=1 ][line width=0.75]    (10.93,-3.29) .. controls (6.95,-1.4) and (3.31,-0.3) .. (0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29)   ;
%Straight Lines [id:da6400107435780602]
\draw [color={rgb, 255:red, 246; green, 0; blue, 0 }  ,draw opacity=1 ]   (293.35,54.31) -- (346.86,31.78) ;
\draw [shift={(348.71,31)}, rotate = 517.1700000000001] [color={rgb, 255:red, 246; green, 0; blue, 0 }  ,draw opacity=1 ][line width=0.75]    (10.93,-3.29) .. controls (6.95,-1.4) and (3.31,-0.3) .. (0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29)   ;
%Straight Lines [id:da6946145063260911]
\draw  [dash pattern={on 0.84pt off 2.51pt}]  (230.71,144.63) -- (431.74,146.08) ;
%Shape: Circle [id:dp8427051743011251]
\draw  [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ,fill opacity=1 ] (329.22,145.35) .. controls (329.22,144.25) and (330.12,143.35) .. (331.22,143.35) .. controls (332.33,143.35) and (333.22,144.25) .. (333.22,145.35) .. controls (333.22,146.46) and (332.33,147.35) .. (331.22,147.35) .. controls (330.12,147.35) and (329.22,146.46) .. (329.22,145.35) -- cycle ;
%Straight Lines [id:da27290473589018815]
\draw  [dash pattern={on 4.5pt off 4.5pt}]  (293.35,54.31) -- (331.22,145.35) ;
%Straight Lines [id:da0371987429410201]
\draw  [dash pattern={on 4.5pt off 4.5pt}]  (230.71,144.63) -- (329.22,145.35) ;
%Shape: Arc [id:dp6875478093811267]
\draw  [draw opacity=0] (309.93,145.01) .. controls (309.83,144.38) and (309.78,143.73) .. (309.78,143.07) .. controls (309.78,137.03) and (314.08,132.14) .. (319.39,132.14) .. controls (321.29,132.14) and (323.06,132.76) .. (324.55,133.84) -- (319.39,143.07) -- cycle ; \draw   (309.93,145.01) .. controls (309.83,144.38) and (309.78,143.73) .. (309.78,143.07) .. controls (309.78,137.03) and (314.08,132.14) .. (319.39,132.14) .. controls (321.29,132.14) and (323.06,132.76) .. (324.55,133.84) ;
%Straight Lines [id:da22017865510269963]
\draw    (236,159.06) -- (330,160.94) ;
\draw [shift={(333,161)}, rotate = 181.15] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;
\draw [shift={(233,159)}, rotate = 1.15] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle    ;
%Straight Lines [id:da5564189152636927]
\draw  [dash pattern={on 0.84pt off 2.51pt}]  (293.35,54.31) -- (404,56) ;
%Shape: Free Drawing [id:dp703247676082269]
\draw  [color={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.75] [line join = round][line cap = round] (318,48) .. controls (318,51.33) and (318,61.33) .. (318,58) .. controls (318,54.33) and (318.56,50.62) .. (318,47) .. controls (317.78,45.6) and (314.37,42.74) .. (315,44) .. controls (316.97,47.94) and (319,48.69) .. (319,54) ;
%Shape: Free Drawing [id:dp2465244774746833]
\draw  [color={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.75] [line join = round][line cap = round] (314,45) .. controls (319.59,45) and (317,56.13) .. (317,56) .. controls (317,52.65) and (317.5,49) .. (316,46) .. controls (315.94,45.87) and (315.24,41.76) .. (314,43) .. controls (313.59,43.41) and (316,47.37) .. (316,48) ;

% Text Node
\draw (287,117) node [anchor=north west][inner sep=0.75pt]    {$60^{\circ }$};
% Text Node
\draw (270,159) node [anchor=north west][inner sep=0.75pt]    {$1m$};
% Text Node
\draw (262.03,99.47) node [anchor=north west][inner sep=0.75pt]    {$1m$};
% Text Node
\draw (208,94) node [anchor=north west][inner sep=0.75pt]  [font=\Large]  {$v$};
% Text Node
\draw (306,11) node [anchor=north west][inner sep=0.75pt]  [font=\Large]  {$v$};
% Text Node
\draw (321.03,42.65) node [anchor=north west][inner sep=0.75pt]  [font=\small]  {$30^{\circ }$};

\end{tikzpicture}
\end{center}
\end{solution}
\section{Problem 6}
\begin{solution}
For a low resistivity fluid, consider a bunch of fluid elements forming a loop. As the fluid moves, the loop changes shape, expands/contacts, etc.\par
If the magnetic field through the loop changes, there is an electric field curl induced. But, that leads to the flow of current, which opposes the change in magnetic field. In the limit of very low resistivity, the magnetic field through the loop can not change. It stays a constant.\par
Now, let us consider two loops at $t=0$ in the fluid as shown.\par
\begin{center}
\tikzset{every picture/.style={line width=0.75pt}} %set default line width to 0.75pt

\begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-1,xscale=1]
%uncomment if require: \path (0,300); %set diagram left start at 0, and has height of 300

%Flowchart: Data [id:dp7035880816369227]
\draw  [fill={rgb, 255:red, 246; green, 0; blue, 0 }  ,fill opacity=0.31 ] (219.34,41.25) -- (248.87,8.82) -- (246.95,180.3) -- (217.41,212.73) -- cycle ;
%Shape: Rectangle [id:dp04887569784950463]
\draw  [fill={rgb, 255:red, 255; green, 149; blue, 149 }  ,fill opacity=0.3 ] (151.2,94) -- (362.19,94) -- (321.68,121.11) -- (110.69,121.11) -- cycle ;
%Straight Lines [id:da09905766820455364]
\draw    (372.45,96.23) -- (328.76,125.98) ;
\draw [shift={(327.11,127.11)}, rotate = 325.75] [color={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.75]    (10.93,-3.29) .. controls (6.95,-1.4) and (3.31,-0.3) .. (0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29)   ;
\draw [shift={(374.11,95.11)}, rotate = 145.75] [color={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.75]    (10.93,-4.9) .. controls (6.95,-2.3) and (3.31,-0.67) .. (0,0) .. controls (3.31,0.67) and (6.95,2.3) .. (10.93,4.9)   ;
%Straight Lines [id:da7533540101666225]
\draw    (81.11,112.11) -- (81.11,14.11) ;
\draw [shift={(81.11,12.11)}, rotate = 450] [color={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.75]    (10.93,-3.29) .. controls (6.95,-1.4) and (3.31,-0.3) .. (0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29)   ;
\draw [shift={(81.11,114.11)}, rotate = 270] [color={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.75]    (10.93,-3.29) .. controls (6.95,-1.4) and (3.31,-0.3) .. (0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29)   ;
%Straight Lines [id:da901491630243338]
\draw    (102.11,219.1) -- (324.11,218.12) ;
\draw [shift={(326.11,218.11)}, rotate = 539.75] [color={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.75]    (10.93,-3.29) .. controls (6.95,-1.4) and (3.31,-0.3) .. (0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29)   ;
\draw [shift={(100.11,219.11)}, rotate = 359.75] [color={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.75]    (10.93,-3.29) .. controls (6.95,-1.4) and (3.31,-0.3) .. (0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29)   ;

% Text Node
\draw (113.8,89.28) node [anchor=north west][inner sep=0.75pt]  [font=\large,rotate=-53.78]  {$1$};
% Text Node
\draw (201,222.4) node [anchor=north west][inner sep=0.75pt]    {$dx$};
% Text Node
\draw (57,55.4) node [anchor=north west][inner sep=0.75pt]    {$dy$};
% Text Node
\draw (352.61,114.51) node [anchor=north west][inner sep=0.75pt]    {$dz$};
% Text Node
\draw (206,12.4) node [anchor=north west][inner sep=0.75pt]  [font=\large]  {$2$};

\end{tikzpicture}
\end{center}
The loop $1$ has flux $B_0 dx dz$ through it, Whereas loop $2$ has flux $0$ through it.\par
Now, let us look at where these loops will end up after a time $t$ and how they will look.\par
The loops are moved ahead by $vt$, and oriented as shown below: \par
\begin{center}
\tikzset{every picture/.style={line width=0.75pt}} %set default line width to 0.75pt

\begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-1,xscale=1]
%uncomment if require: \path (0,300); %set diagram left start at 0, and has height of 300

%Shape: Polygon [id:ds916886588727925]
\draw  [fill={rgb, 255:red, 0; green, 31; blue, 255 }  ,fill opacity=0.18 ] (204.11,116.47) -- (443.11,118.47) -- (380.11,151.47) -- (141.11,151.47) -- cycle ;
%Shape: Polygon [id:ds05642300854837812]
\draw  [fill={rgb, 255:red, 0; green, 40; blue, 255 }  ,fill opacity=0.27 ] (395.11,58.47) -- (332.11,82.47) -- (189.11,220.47) -- (248.11,197.47) -- cycle ;
%Straight Lines [id:da3195531099085156]
\draw  [dash pattern={on 4.5pt off 4.5pt}]  (295.11,48.47) -- (298.11,213.47) ;
%Curve Lines [id:da3017736924368517]
\draw    (311.11,103.47) .. controls (309.11,97.47) and (299.11,95.47) .. (296.11,101.47) ;
%Straight Lines [id:da5840092338247029]
\draw    (402.87,160.52) -- (466.35,126.42) ;
\draw [shift={(468.11,125.47)}, rotate = 511.75] [color={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.75]    (10.93,-3.29) .. controls (6.95,-1.4) and (3.31,-0.3) .. (0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29)   ;
\draw [shift={(401.11,161.47)}, rotate = 331.75] [color={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.75]    (10.93,-3.29) .. controls (6.95,-1.4) and (3.31,-0.3) .. (0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29)   ;
%Straight Lines [id:da20333438746325694]
\draw    (119.07,216.47) -- (116.14,53.47) ;
\draw [shift={(116.11,51.47)}, rotate = 448.97] [color={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.75]    (10.93,-3.29) .. controls (6.95,-1.4) and (3.31,-0.3) .. (0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29)   ;
\draw [shift={(119.11,218.47)}, rotate = 268.97] [color={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.75]    (10.93,-3.29) .. controls (6.95,-1.4) and (3.31,-0.3) .. (0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29)   ;
%Straight Lines [id:da6448390957358343]
\draw    (129.11,224.5) -- (375.11,228.44) ;
\draw [shift={(377.11,228.47)}, rotate = 180.92] [color={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.75]    (10.93,-3.29) .. controls (6.95,-1.4) and (3.31,-0.3) .. (0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29)   ;
\draw [shift={(127.11,224.47)}, rotate = 0.92] [color={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.75]    (10.93,-3.29) .. controls (6.95,-1.4) and (3.31,-0.3) .. (0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29)   ;

% Text Node
\draw (301,76.4) node [anchor=north west][inner sep=0.75pt]    {$\theta $};
% Text Node
\draw (154.71,122.06) node [anchor=north west][inner sep=0.75pt]  [rotate=-60.82]  {$1$};
% Text Node
\draw (344.59,51.2) node [anchor=north west][inner sep=0.75pt]  [rotate=-338]  {$2$};
% Text Node
\draw (442,146.4) node [anchor=north west][inner sep=0.75pt]    {$dz$};
% Text Node
\draw (89,106.4) node [anchor=north west][inner sep=0.75pt]    {$dy$};
% Text Node
\draw (227,233.4) node [anchor=north west][inner sep=0.75pt]    {$dx$};

\end{tikzpicture}
\end{center}
The flux through loop $2$ is still $0$. The flux through loop 1 is still $B_0 dx dz$. \par
Thus, the magnetic field looks as shown:

\end{solution}
\section{Problem 7}
\begin{solution}
Light rays going toward a focus of the hyperbola, upon reflection, change their paths so as to go through the other focus. Following the light path, we see that no rays can get to the point $O_1$.
    \begin{center}
    \includegraphics[width=0.5\textwidth]{okkkkk.png}
    \end{center}
\end{solution}
\section{Problem 8}
\begin{solution}

\end{solution}
\section{Problem 9}
\begin{solution}
Since $R<<d$, $\vec{E}$ everywhere except near hemisphere will be:
$$
\boxed{
    |\vec{E}|=\frac{V<em>0}{d}
}
$$

In uniform electric field grounded sphere gets polarised with dipole moment:

%Insert Fig 2 here

$$
\boxed{
    | \vec{p} |=\frac{4}{3} \pi R^3 3\epsilon</em>{0} \vec{E<em>0}
}
$$

So, surface charge density will be:

%Insert Fig 3 here

$$\boxed{
\sigma = -3\epsilon</em>{0} E<em>0 cos\theta
}
$$

%Insert Fig 4 here

$$\boxed{\vec{E} = \frac{\sigma}{\epsilon</em>{0}}=-3E_0 cos\theta \hat{r}} $$

Ohms law:

$$\vec{J}=\sigma \vec{E}$$
$$\vec{J} = -3E_0 \cos \theta \sigma \hat{r}$$
$$\ \ \ = -3\sigma \cos\theta\frac{V_0}{d} \hat{r}$$

So, total current flowing inside hemisphere will be
$$ I= \int \vec{J} \cdot d \vec{A}$$
$$\ \ \ = \int_0^{\frac{\pi}{2}} 3\sigma \cos\theta\frac{V_0}{d} \cdot 2\pi R \sin \theta R d \theta$$

$$\boxed{\text{Hence, Answer=} \frac{3\pi R^2 \sigma V_0}{d}}$$
\end{solution}

\section{Problem 10}
\begin{solution}

Let's analyse the magic wand at an arbitrary distance $x$ from the left end, where $0 \leq x \leq l$

Infinitesimal resistance is \[dR = \frac{\rho}{\pi \left(R_0 + r {\sin{\theta}}^2 \frac{2 \pi x}{a} \right)} dl = \frac{\rho dx}{\pi R_{0}^2 \left( 1 + \frac{r}{R_0} \sin^2 \frac{2 \pi x}{a} \right)}\]
\[\approx \frac{\rho dx}{\pi R_{0}^{2} \left( 1 + \frac{2r}{R_0} \sin^2 \frac{2 \pi x}{a} \right)}\]
Bionomial approximation gives \[R \approx \frac{\rho dx}{\pi R_{0}^{2}} \left( 1 - \frac{2r}{R_0} \sin^2 \frac{2 \pi x}{a} \right) = \frac{\rho dx}{\pi R_{0}^{2}} \left[ 1 - \frac{r}{R_0} \left( 1 - \cos \frac{4\pi x}{a} \right) \right] = \frac{\rho dx}{\pi R_{0}^2} \left( 1 - \frac{r}{R_0} + \frac{r}{R_0} \cos \frac{4 \pi x}{a} \right)\]

Now, we integrate $dR$ over whole wand with limits from $0$ to $l$
\[R = \int_{0}^{l} \frac{\rho dx}{\pi R_{0}^2} \left( 1 - \frac{r}{R_0} + \frac{r}{R_0} \cos \frac{4 \pi x}{a} \right)\]
\[= \frac{\rho dx}{\pi R_{0}^2} \left[ \left( 1 - \frac{r}{R_0} \right) x \right]^{l}_{0} + \left[ \frac{ar}{4 \pi R_0} \sin \frac{4 \pi x}{a} \right]^{l}_{0} = \frac{\rho l}{\pi R_{0}^2} \left( 1 - \frac{r}{R_0} \right)\]
Hence, the resistance is \[\boxed{R = \frac{\rho l}{\pi R_{0}^2} \left( 1 - \frac{r}{R_0} \right)}\]
\end{solution}

\end{document}

max_stars_repo_name: GRAMOLY-ORG/FIZIKA

max_issues_repo_name: GRAMOLY-ORG/FIZIKA

max_forks_repo_name: GRAMOLY-ORG/FIZIKA


text:
% Note: this file can be compiled on its own, but is also included by
% diss.tex (using the docmute.sty package to ignore the preamble)
\documentclass[12pt,a4paper,twoside]{article}
\usepackage[pdfborder={0 0 0}]{hyperref}
\usepackage[margin=25mm]{geometry}
\usepackage{graphicx}
\usepackage{parskip}
\begin{document}

\newcommand{\sups}{\textsuperscript}

\section*{Introduction}

Language has evolved and therefore probably gave an evolutionary advantage to the individuals that exhibited it. As Angelo Cangelosi and Domenico Parisi described in a 1998 paper\footnote{\url{https://doi.org/10.1080/095400998116512}}, it is difficult to investigate the evolutionary origin of language and the selective pressures that may have originated language due to the limited evidence available. They propose using computer simulations of evolutionary scenarios to investigate this. In the paper referenced, they describe a simulated toy world where agents controlled by neural-networks interact with an environment of mushrooms that are edible and poisonous. This simulation and the ideas explored in the paper will be the basis for my project.

In the paper, Cangelosi and Parisi use small feed-forward neural networks to control the behaviour of each agent. The weights are initially random; a genetic algorithm is used to improve the fitness of the species over many generations. The agents are also given linguistic abilities; input and output nodes of the neural networks produce signals that allow for communication.

By creating three different populations (one without language, one with an externally imposed language and one with an evolved language) we can investigate the evolutionary advantage of language. Furthermore, it allows us to investigate a key question posed in the paper: \emph{``Since language requires the parallel evolution of linguistic production and linguistic comprehension, how can language evolve when it has a purely informative function and therefore it is advantageous to the receiver but not the producer?''}

For this project, I will re-implement the simulation described. I will then create analysis tools to investigate the findings of the paper to see if I observe the same results.

\section*{Starting Point}

I have a small amount of experience in programming simulations; for my A-Level project in 2016, I created a simulation of virus propogation between mosquito and human agents in the Unity game engine.

I do not have any experience programming neural networks, however, I am confident that I understand the backpropagation algorithm and basic neural network structure through the Artificial Intelligence course I took last year. In the papers I plan to reference, Cangelosi very clearly describes the structure of the neural networks he uses and I am confident that I will be able to follow his work.

Over the summer I read a book titled Simulating the Evolution of Language which gave me an overview of the techniques used in this field. Alongside the Formal Models of Language course that I took last year, I now have a sufficient base of understanding to begin this project.

\section*{Work to be Done}

The work for this project can be roughly divided into two stages; implementing the simulation and constructing the means of evaluating my implementation against the findings in the original paper. I will also regularly be creating tests to evaluate my simulation.

\subsection*{Implementing the Simulation}

\begin{enumerate}

\item Set up the simulation environment by creating the world grid and implementing the properties of poisonous and edible mushrooms. Create the simulation loop divided into regular `epochs'.

\item Create the agents for the simulation, giving them position and energy properties.

\item Implement feedforward neural networks to control the behaviour of the agents; input units to identify the location of the nearest mushroom, visual perception units to observe mushroom properties (only when close enough) and signal perception units for when language is implemented. The output units control the movement of the agent and production of signals. There will also be hidden units.

\item Implement the genetic algorithm that runs after all agents complete the simulation. The fittest agents are determined by the energy level (based on eating edible mushrooms and avoiding poisonous mushrooms). The fittest agents are then chosen for asexual reproduction, producing offspring that have genetic mutations in the form selecting a percentage of the weights to change by a random amount.

\item Create two different populations, one without language (where the signal perception units are always set to the same, constant value) and one with an externally imposed language (where the signal perception units are set to one of two signals depending on the type of the nearest mushroom).

\item Create a third population with an evolved language. Instead of externally imposed signals, in each simulation cycle one of the other agents is randomly selected as the `speaker' and its output is connected to the input signal perception units of the `listener'.

\end{enumerate}

\subsection*{Analysis}

\begin{enumerate}

\item Plot the average fitness over the number of generations to compare between the three populations.

\item Produce some behavioural tests to investigate the behaviour of random individual organisms at specific generations.

\item Plot the frequency distribution of the different signals produced by the individuals with the evolved language using a `naming task'.

\item Calculate the Quality Index (QI) of the language produced by the population without language and the population with an evolved language to investigate the genetic advantage of producing productive signals. The QI evaluates the efficiency of a language based off of three criteria; (1) functionally distinct categories are labeled with distinct signals, (2) a single signal tends to be used to label all the instances within a category and (3) all the individuals in the population tend to use the same signal to label the same category.

\item Investigate the correlation between QI of the language and the fitness of the species to determine if change in the language or in the categorisation skill of the agents affects the other ability.

\end{enumerate}

\subsection*{Testing}

To evaluate my project and ensure that my simulation implementation is functional, I will create an ensemble of unit tests for each of the tasks above. These will be created in parallel as I develop each part of the implementation. For the simulation, this will involve small examples or scenarios to show that each part of the simulation is fully functional.

\section*{Success Criterion}

The project will be deemed a success if I can implement the simulation as described in the tasks above (evaluated by my unit tests) and if I can implement the analysis tools to compare the findings of my implementation to the findings of the original paper.

\section*{Timetable and Milestones}

I've broken down this timetable into two and three week intervals. At the end of December, I will be writing my Progress Report and simultaneously making adjustments to the timetable as needed.

\subsection*{25\sups{th} October -- 10\sups{th} November}

\emph{Middle of Michaelmas Term. Includes first deadline for NLP coursework.}

{\bf Task:} Create a high-level design of the system. Set up the project files with a version-control system. Experiment with creating small simulations in python and do suitable research into Neural Network libraries.

{\bf Milestones:} Have a git repository with project files. Have a design plan with specific details of the simulation confirmed.

\subsection*{11\sups{th} November -- 24\sups{th} November}

\emph{Middle of Michaelmas Term.}

{\bf Task:} Complete implementation tasks 1 and 2 as described above. Experiment with adding Neural Networks to control the behaviour of the agents.

{\bf Milestones:} Have a working simulation environment with poisonous and edible mushrooms. Have agents with positions and energy values but no functional neural networks yet.

\subsection*{25\sups{th} November -- 8\sups{th} December}

\emph{End of Michaelmas Term. Includes second and third deadline for NLP coursework.}

{\bf Task:} Complete implementation tasks (3). Start working on implementation task (4).

{\bf Milestones:} Have the agents successfully controlled by neural networks. Be able to run an entire lifespan of one agent within the simulated world.

\subsection*{9\sups{th} December -- 22\sups{nd} December}

\emph{Christmas holiday. Will likely be in Cambridge to help with Queens' interviews.}

{\bf Task:} Complete implementation tasks (4), (5) and (6). Also aim to complete analysis tasks (1) and (3).

{\bf Milestones:} Have a fully functional simulation that allows for running a thousand generations of a population of agents. Have three different populations to compare; one without language, one with an externally imposed language and one with an evolved language. Have a tool to graph the average fitness of each population over the number of generations and another tool to view the probability distribution of the signals chosen for the evolved language over the number of generations.

\subsection*{23\sups{rd} December -- 12\sups{th} January}

\emph{Christmas holiday. Will take a break to revise Michaelmas courses and to spend time with family.}

{\bf Task:} Complete analysis task (2). Write the Preparation chapter of the Dissertation. Review the timetable for the remainder of the project and adjust in light of experience so far. If ahead of schedule, plan time for extensions. Start to plan tests cases.

{\bf Milestones:} An outline of the dissertation document with a completed Preparation section.

\subsection*{13\sups{th} January -- 2\sups{nd} February}

\emph{Start of Lent term. Will have regular labs for Mobile Robot Systems.}

{\bf Progress Report Deadline:} 31\sups{st} January

{\bf Task:} Write the Progress Report. Start to fill out the Implementation chapter of the Dissertation. Complete analysis tasks (4) and (5).

{\bf Milestones:} Progress report submitted and entire project reviewed both personally and with overseers. Have tools to plot the Quality Index of the evolved language against the fitness of the population. At this point, all the tasks in the {\bf Work to Do} section will have been completed, satisfying the {\bf Success Criteria}.

\subsection*{3\sups{rd} February -- 23\sups{rd} February}

\emph{Middle of Lent term. Both deadlines for the Mobile Robot Systems assignments.}

{\bf Task:} Begin analysis of the simulation. Begin to work on extensions to the project, keeping in mind time needed to write the Dissertation.

{\bf Milestones:} Have the start of a test suite with a series of diagrams to use to evaluate my implementation.

\subsection*{24\sups{th} February -- 15\sups{th} March}

\emph{End of Lent term. Deadline for the Mobile Robot Systems mini-project report.}

{\bf Task:} Complete testing. Evaluate the outcomes of the tests against the findings in the original paper. At this point, the second half of the {\bf Success Criteria} will have been achieved. If needed, revise the implementation to be clean, documented and consise. Work on other extensions.

{\bf Milestones:} Examples and test cases run with results collected. Code should perform a variety of interesting tasks and should be in a state that in the worst case it would satisfy the examiners with at most cosmetic adjustment

\subsection*{16\sups{th} March -- 5\sups{th} April}

\emph{Start of Easter holiday. Might stay in Cambridge for part of it to work. Will balance revision and work on the project.}

{\bf Task:} Complete work on any extensions. Draft the Evaluations and Conclusions chapters of the Dissertation.

{\bf Milestones:} Extensions almost complete. Skeleton of entire Dissertation in place.

\subsection*{6\sups{th} April -- 19\sups{th} April}

\emph{End of Easter holiday. Might get back to Cambridge early to work. Will balance revision and work on the project.}

{\bf Task:} Complete the Implementation and Introduction chapters of the Dissertation. Send the full draft to Director of Studies and Supervisors by 21st of April.

{\bf Milestones:} Dissertation essentially complete, with large sections of it proof-read by Supervisors and possibly friends and/or Director of Studies.

\subsection*{20\sups{th} April -- 8\sups{th} May}

\emph{Start of Easter Term. Will be balancing revision, lectures and final work on the project.}

{\bf Final Deadline:} 8\sups{th} May

{\bf Task:} Finish Dissertation, preparing diagrams for insertion. Review the whole project, checking the Dissertation and spending the final few days on whatever is in greatest need of attention. Aim to submit the dissertation at least a week before the deadline.

{\bf Milestone:} Submission of Dissertation

\section*{Possible Extensions}

\subsection*{Graphic Visualisation}

As a side extension, I could implement a visual interface to watch the life of one agent within the simulation. This would involve rendering a simple 2D world with textures for the agents and mushrooms. This could be expanded further by adding a User Interface for setting up the simulation and having windows showing the progress as it occurs live.

\subsection*{Symbolic Theft vs. Sensorimotor Toil}

In a 2000 paper\footnote{\url{http://cogprints.org/2036/}}, Cangelosi and Harnad use a similar same toy world of mushrooms and foragers to place two ways of acquiring categories in direct competition with each other. They compare ``sensorimotor toil'' (where categories are acquired through real-time, feedback-correct, trial and error experience) to ``symbolic theft'' (where new categories are acquired by hearsay from boolean combinations of symbols \emph{describing} them). They find that the origins of natural language could be explained by the apparent infinitely superiority of a hybrid symbolic/sensorimotor combination compared to purely sensorimotor precursors.

As an extension, I could expand my simulation to investigate the findings of this paper. This involves implementing a more complicated neural network, adding supervised learning through back-propagation, implementing more sophisticated mushroom features and expanding the simulation to host multiple populations at once.

\subsection*{Investigating the Evolution of Syntax}

In a 1999 paper\footnote{\url{https://link.springer.com/chapter/10.1007/3-540-48304-7_86}}, Cangelosi expands the toy mushroom world simulation further to investigate how languages that use combinations of words (such as the ``verb-object'' rule) can emerge by auto-organisation and cultural transmission. Mushrooms are either edible or poisonous but also have one of three colours - the edible mushrooms of a particular colour correspond to a particular action in response.

In this extended simulation, after the first 300 generations parents and children co-exist within the simulated world. Parents teach the evolved language to their children. Children undergo a Listening Task (where parents describe the closest mushroom) and a Naming Task (where the mushroom name is used for supervised learning through backpropagation).

This is a substantial increase in complexity but allows would allow me to investigate the evolution of a more complex language.

 \section*{Resources Declaration}

For this project, I plan to use my computer, (2.8 GHz CPU, 16 GB RAM, 750GB Flash Storage,
macOS Mojave). The code will be regularly pushed to a GitHub repository to be able to recover from failure or loss on my local machine. I will also create weekly backups on an external hard-drive to provide another source of recovery. Should my machine fail, I will be able to continue working on an MCS machine. I accept full responsibility for this machine and I have made contingency plans to protect myself against hardware and/or software failure.

I will also need to use the high powered computer when running large simulations to save processing time.

 \end{document}

ext: tex

max_stars_repo_name: ZGoriely/Part-II-Project

max_issues_repo_name: ZGoriely/Part-II-Project

max_forks_repo_name: ZGoriely/Part-II-Project


text:
\documentclass{beamer}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% settings
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usetheme{metropolis}
\usepackage{ccicons}
\usepackage{hyperref}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% metadata
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\title{A minimal example}
\date{\today}
\author{Josef Wachtler}
\institute{Educational Technology, Graz University of Technology}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% begin document
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% title and content page
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\maketitle

\begin{frame}
  \frametitle{Content}
  \tableofcontents%[hideallsubsections]
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% First Section
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{First Section}

\begin{frame}{First Frame}
Hello, world!
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Conclusion
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{Conclusion}

\begin{frame}{Thank you! ;-)}

  \begin{center}
    \begin{huge}
      Questions?
    \end{huge}
  \end{center}

  \begin{itemize}
    \item DI Dr. Josef Wachtler BSc \\
    Educational Technology, Graz University of Technology
    \item \href{mailto:josef.wachtler@tugraz.at}{josef.wachtler@tugraz.at}
    \item \href{https://josefwachtler.wordpress.com/}{josefwachtler.wordpress.com}
    \item Slides: \href{https://github.com/wachjose88/slides}{github.com/wachjose88/slides}
  \end{itemize}

\end{frame}

\begin{frame}{Credits}

  Slides created by Josef Wachtler
  \href{mailto:josef.wachtler@tugraz.at}{josef.wachtler@tugraz.at}
  and licensed under a
  \href{http://creativecommons.org/licenses/by/4.0/}{Creative Commons
        Attribution 4.0 International (CC BY 4.0) License}.

  \begin{center}
    \begin{huge}
      \ccby
    \end{huge}
  \end{center}

  \begin{tiny}
    The theme \emph{itself} is licensed under a
    \href{http://creativecommons.org/licenses/by-sa/4.0/}{Creative Commons
    Attribution-ShareAlike 4.0 International License}
    and can be downloaded at
    \href{https://github.com/matze/mtheme}{github.com/matze/mtheme}.
    This does not affect the presentation created with the theme.
  \end{tiny}

\end{frame}

%\begin{frame}[standout]
%  Questions?
%\end{frame}

\end{document}


text:
\documentclass[9pt,twocolumn,twoside]{../../styles/osajnl}
\usepackage{fancyvrb}
\journal{i524}

\title{An overview of the open source log management tool - Graylog}

\ociscodes{Cloud, I524}
\author[1]{Rahul Singh}

\affil[1]{School of Informatics and Computing, Bloomington, IN 47408, U.S.A.}

\affil[*]{Corresponding authors: rahpsing@iu.edu}

\dates{paper2, \today}

\ociscodes{Cloud, I524}

% replace this with your url in github/gitlab
\doi{\url{https://github.com/rahpsing/sp17-i524/paper2/S17-IR-2036/report.pdf}}

\begin{abstract}
Graylog is an open source log management tool that allows an
organization to collect, organize and analyze large amounts of data
from its network activity. It enhances the basic log management
functionality by providing network traffic analysis, lucene syntax
based search, drill-down analysis of data using field statistics and
generates trigger actions based alert notifications. It integrates
with other open source technologies to address a larger distributed
system.
\newline
\end{abstract}

\setboolean{displaycopyright}{true}

\begin{document}

\maketitle
\TODO{This review document is provided for you to achieve your
  best. We have listed a number of obvious opportunities for
  improvement. When improving it, please keep this copy untouched and
  instead focus on improving report.tex. The review does not include
  all possible improvement suggestions and if you sea comment you may
  want to check if this comment applies elsewhere in the document.}

\section{Introduction}
Graylog \CE allows management of an organization's computing resources in
a consistent way. It allows us to centrally collect and manage log
messages of an organization’s complete infrastructure. A user can
perform search on terrabytes \SE of log data to discover number of failed
logins,find application errors across all servers or monitor the
acivity \SE of a suspicious user id. Graylog works on top of ElasticSearch \CE
and MongoDB \CE to facilitate this high availability searching. It
provides a lucene \TE \CE like query language, a processing pipeline for data
transformation, alerting abilities and much more. Graylog enables
organizations, at a fraction of the cost, to improve IT operations
efficiency, security, and reduce the cost of IT \cite{www-graylog-crunchbase}
\TODO{This reference is invalid. Check it please. Shouldn't it be
https://www.graylog.org/}.

\section{Architecture}

Graylog is written in Java and uses a few key open source technologies
like Elasticsearch and MongoDB. Additionally, for a larger setup
Apache Kafka \CE or Rabbit MQ \CE could be integrated to implement queueing.
A basic Graylog cluster consists of the following components \CE:
\newline
\newline
Graylog server - It is the actual log processor system also
responsible for implementing security. The Graylog server nodes shall
be operated on the fastest CPU's available.
\newline
\newline
Graylog web UI - It is the Graylog web user interface where one can
view histograms, dashboards and create alerts.
\newline
\newline
MongoDB - MongoDB stores Graylog configuration information and the non
queried log messages. It prime purpose in the architecture is Metadata
Management \cite{www-graylogprocessing-severalnines}.
\newline
\newline
ElasticSearch - ElasticSearch is useful for storing actual log data
and perform search operations on them. Elasticsearch nodes should have
as much RAM as possible and the fastest disks linked to them. Messages
are only stored on Elasticsearch nodes. If we have data loss on
Elasticsearch, all messages are gone – except if the administrator has
created backups of the indices.

\begin{figure}[htbp]
\centering
\fbox{\includegraphics[width=40mm,height=40mm]{images/min_architecture_graylog}}
\caption{\cite{www-graylog-docs} Graylog minimum architecture}
\label{fig:Graylog Minimum Architecture}
\end{figure}

\section{Graylog Use Cases}

\subsection{Computer And Network Security}

The best way for intrusion detection is to monitor activity of all the
devices in the network.  Graylog allows a user to keep track of all
failed logins, rejected network connections or exceptions in the flow
of the application. It also allows a user to integrate other Intrusion
Detection Systems (IDS) to correlate detected activity with logs from
all across the infrastructure \cite{www-graylog-org}.

\subsection{Centralized IT management}

Logging into every system and parsing the plain text log files to find
meaningful data is an arduous task for any IT engineer. Graylog allows
us to centrally collect all syslog and eventlog messages of the
complete infrastructure thus allowing to solve production issues in
real time. It does so by allowing the administrator to setup alerts
for any trigger actions like performance degradation or exceptions.

\subsection{Development and DevOps}

Graylog allows on demand monitoring of distributed applications by
giving tiered access to any developer in the organization to view
system and application logs. It works on top of elastic search nodes
to facilitate search operation on terrabytes \SE of log data in a metter \SE
of milliseconds. In case of a customer operation resulting in an
error, a developer shall need to search the logs with the customer id
and locate the relevant logs to find the root cause of the problem.

\section{Graylog Modules}

\subsection{Sending in log data}

Graylog needs a log source to serve its purpose. The message input
section is launched from the System -> Inputs
\TODO{What's the arrow here?} section from the web
interface (or the REST API \CE) and can be configured without the need to
restart any part of the system \cite{www-graylog-sending_data}.

Graylog is able to accept and parse RFC 5424 \CE and RFC 3164 \CE compliant
syslog messages and the Graylog Extended Log Format (GELF)
\cite{www-graylog-sending_data}. For any devices on the network that
do not publish RFC compliant syslog messages we need to make use of
the plaintext messages.  The Graylog Extended Log Format (GELF)
\TODO{To mentioned a term for the second time use the abbreviation since you
already mentioned it in previous context.}
is a
log format that avoids the shortcomings of classic plain syslog by
providing optional compression, fixed structure and a limits to
payload length to 1024 bytes. Syslog is prefered \SE for direct logging by
machines in the network while GELF is suitable for logging from within
the applications.

\subsection{Search}

As Graylog uses ElasticSearch to facilitate searching, the search
syntax followed is very close to the Lucene syntax which is the
underlying implementation of Elastic Search. By default, search is
performed over all fields unless a specific field is specified in the
search query. Search features like fuzzy, wildcard, range searches
provided by Elastic Search API can be used to gain deeper insight to
data.  Graylog also provides a time frame selector which defines the
time range over which the search shall be performed. The time selector
could be relative, absolute or keyword based.<could extend this>
\TODO{Please delete your TODO before submission.}
Graylog also allows a user to save his searches to view it later. A
user needs to save his search by a unique name and could load it later
from the system under the saved search selector.

Graylog automatically constructs a histogram for the search
results. The histogram depicts the concise number of messages received
grouped by a certain time period that is adjustable.  Based on a
user’s recent search queries, graylog also allows you to distinguish
data that are not searched upon very often and thus can be archived on
cost effective storage drives.

\subsection{Log Streams}

Graylog allows a user to create a set of rules to route messages into
user defined categories. A user could create a stream called 'Database
errors' and create a rule to direct all messages with the source
attribute as 'database' to that stream. Thus, the stream 'Database
errors' shall catch every error message from the system's database
hosts. A message shall be routed into every stream that has the
corresponding matching rule for the message. A message thus, can be
part of many streams and not just one \cite{www-graylog-streams}.

\subsection{Alerts}

Graylog alerts are periodical searches that can trigger some
notifications when a defined condition is satisfied
\cite{www-graylog-alerts}. To get notified when more than 50
exceptions occur in the range of a minute, an alert can be created
with the desired conditions.  While defining alerts, a user can also
specify the method of notification once the alert condition is
met. Notifications can be obtained by an email or by an HTTP request
to an endpoint in the system.

\subsection{Dashboards}

Graylog provides visualization through creation of dashboards that
allows a user to build pre-defined views on his data to assemble all
of his important data only a single click away
\cite{www-graylog-dashboards}. Any search result or metric shall be
added as a widget on the dashboard to observe trends in one single
location.  A user can also add search result metrics like result
count, statistical values, field value charts and stack charts to the
dashboard. These dashboards can also be shared with other users in the
organization.

\subsection{Full control and access through a REST API}

Both configuration settings and log data are available through the
Graylog REST API.  The Graylog web interface uses Graylog Rest API
internally to interact with the Graylog cluster. Graylog REST API
could be used for automation or integrating Graylog into another
system, such as monitoring or ticket systems
\cite{www-graylog-restapi}. Thus a network administrator can easily
integrate Graylog into his evolving architecture and build reports and
analysis.

\subsection{Filtering messages}

Graylog can use Drools \CE to evaluate all incoming messages against a
user defined rules file. To discard any message before its written to
elastic search or to forward it to another system one can use Drools
rules to perform custom filtering \cite{www-graylog-blacklisting}.

\begin{figure}[htbp]
\centering
\fbox{\includegraphics[width=\linewidth]{images/blacklisting_message}}
\caption{\cite{www-graylog-blacklisting} Message filtering rule }
\label{fig:Sample filtering rule}
\end{figure}

\TODO{An isolated figure of code is not allowed. Please either describe it in
its context, or don't put it here.}
\section{Comparision with Splunk}
Splunk \CE is remarked as one of the best log management tools available
and is Graylog's biggest competitor.
\newline
\begin{table}[htbp]
\centering
\caption{\bf Comparision of Graylog and Splunk}
\begin{tabular}{ccc}
\hline
Parameter & Graylog & Splunk \\
\hline
Business Model& Opensource & Commercial software \\
Setup Time & Needs time & No time\\
Learning Curve & Difficult & Simple\\
Filetypes & syslog,gelf & Many\\
Security & Good & Good\\
Apps Supported & Low & Very high\\
\hline
\end{tabular}
  \label{tab:shape-functions}
\end{table}
\TODO{This section includes only one line of introduction and a table without
citation. Please improve.}

\section{Conclusion}
Graylog provides an effective set of features to be adapted by any
small to medium size organization. Alert notifications, sharing of
dashboards and message filtering provide most features that any
network administrator desires from a log management system. Being an
open source tool it is cost effective compared to other log
systems. However, it needs an environment to be setup before it can be
operational. It has a steep learning curve with the responsibility of
managing the MongoDB and ElasticSearch instances being completely
managed by the user.  Hence, the choice to choose Graylog as an
organization's log management tool directly relies on the resources
in terms of either time or money that it chooses to employ.

\TODO{Lack use case in big data.}

% Bibliography

\bibliography{references}
\TODO{Where is the bio?}
\end{document}


text:
    \filetitle{bwf}{Butterworth filter with tunes}{tseries/bwf}

	\paragraph{Syntax}\label{syntax}

\begin{verbatim}
[T,C,CutOff,Lambda] = bwf(X,Order)
[T,C,CutOff,Lambda] = bwf(X,Order,Range,...)
\end{verbatim}

\paragraph{Syntax with output arguments
swapped}\label{syntax-with-output-arguments-swapped}

\begin{verbatim}
[T,C,CutOff,Lambda] = bwf2(X,Order)
[T,C,CutOff,Lambda] = bwf2(X,Order,Range,...)
\end{verbatim}

\paragraph{Input arguments}\label{input-arguments}

\begin{itemize}
\item
  \texttt{X} {[} tseries {]} - Input tseries object that will be
  filtered.
\item
  \texttt{Order} {[} numeric {]} - Order of the Butterworth filter; note
  that \texttt{Order=2} reproduces the Hodrick-Prescott filter
  (\texttt{hpf}) and \texttt{Order=1} reproduces the local linear filter
  (\texttt{llf}).
\item
  \texttt{Range} {[} numeric {]} - Date Range on which the input data
  will be filtered; \texttt{Range} can be \texttt{Inf},
  \texttt{{[}startdata,Inf{]}}, or \texttt{{[}-Inf,enddate{]}}; if not
  specifired, \texttt{Inf} (i.e.~the entire available Range of the input
  series) is used.
\end{itemize}

\paragraph{Output arguments}\label{output-arguments}

\begin{itemize}
\item
  \texttt{T} {[} tseries {]} - Lower-frequency (trend) component.
\item
  \texttt{C} {[} tseries {]} - Higher-frequency (cyclical) component.
\item
  \texttt{CutOff} {[} numeric {]} - Cut-off periodicity; periodicities
  above the cut-off are attributed to trends, periodicities below the
  cut-off are attributed to gaps.
\item
  \texttt{Lambda} {[} numeric {]} - Smoothing parameter actually used;
  this output argument is useful when the option \texttt{'CutOff='} is
  used instead of \texttt{'Lambda='}.
\end{itemize}

\paragraph{Options}\label{options}

\begin{itemize}
\item
  \texttt{'CutOff='} {[} numeric \textbar{} \emph{empty} {]} - Cut-off
  periodicity in periods (depending on the time series frequency); this
  option can be specified instead of \texttt{'Lambda='}; the smoothing
  parameter will be then determined based on the cut-off periodicity.
\item
  \texttt{'CutOffYear='} {[} numeric \textbar{} \emph{empty} {]} -
  Cut-off periodicity in years; this option can be specified instead of
  \texttt{'Lambda='}; the smoothing parameter will be then determined
  based on the cut-off periodicity.
\end{itemize}

\texttt{'infoSet='} {[} \texttt{1} \textbar{} \emph{\texttt{2}} {]} -
Information set assumption used in the filter: \texttt{1} runs a
one-sided filter, \texttt{2} runs a two-sided filter.

\begin{itemize}
\item
  \texttt{'Lambda='} {[} numeric \textbar{} \emph{\texttt{@auto}} {]} -
  Smoothing parameter; needs to be specified for tseries objects with
  indeterminate frequency. See Description for default values.
\item
  \texttt{'level='} {[} tseries {]} - Time series with soft and hard
  tunes on the level of the trend.
\item
  \texttt{'change='} {[} tseries {]} - Time series with soft and hard
  tunes on the change in the trend.
\item
  \texttt{'log='} {[} \texttt{true} \textbar{} \emph{\texttt{false}} {]}
  - Logarithmise the data before filtering, de-logarithmise afterwards.
\end{itemize}

\paragraph{Description}\label{description}

\subparagraph{Default smoothing
parameters}\label{default-smoothing-parameters}

If the user does not specify the smoothing parameter using the
\texttt{'lambda='} option (or reassigns the default \texttt{@auto}), a
default value is used. The default value is based on common practice and
can be calculated using the date frequency of the input time series as
$\lambda = (10 \cdot f)^n$, where $f$ is the frequency (yearly=1,
half-yearly=2, quarterly=4, bi-monthly=6, monthly=12), and $n$ is the
order of the filter, determined by the input parameter \texttt{Order}.

\paragraph{Example}\label{example}

max_stars_repo_name: OGResearch/IRIS-Toolbox-For-Octave

max_issues_repo_name: OGResearch/IRIS-Toolbox-For-Octave

max_forks_repo_name: OGResearch/IRIS-Toolbox-For-Octave


text:
\newpage

\renewcommand{\cleardoublepage}{}
\renewcommand{\clearpage}{}
\chapter{Full Disappearing Tracks Binning and Results} \label{app:distracksbinning}

The following tables provide  predicted background event counts and observed yields for all 68 disappearing tracks search regions (28 for 2016 data, and 40 for 2017--2018 data).

\begin{table}[htbp]

\scriptsize
\centering

\caption[Table of 2016 disappearing tracks search bins.]{Summary of the 28 signal regions of the search for disappearing tracks, for the 2016 data set, together with the corresponding background predictions and observations. For the background
predictions, the first uncertainty listed is statistical (from the limited size of control samples), and the second is systematic. The systematic uncertainty is not shown when it is negligible. Taken from \cite{MT2_2019}. \label{tab:sr1_distracks}}
\renewcommand{\arraystretch}{1.3}
\begin{tabular}{cccclcc}

\hline

Track length & \njet & \Ht range [GeV] & Track \pt [GeV] & Label & Background & Data\\

\hline

\multirow{12}{*}{P}

& \multirow{6}{*}{2--3} & \multirow{2}{*}{[ 250, 450 )} & [ 15, 50 ) & P LL lo & \textbf{15.5} $^{+3.0}_{-2.7}$ $\pm$ 3.2 & \textbf{16}\\ % P LL SR lo

& & & [ 50, $\infty$ ) & P LL hi & \textbf{9.8} $^{+2.6}_{-2.2}$ $\pm$ 2.5 & \textbf{3}\\ % P LL SR hi

& & \multirow{2}{*}{[ 450, 1200 )} & [ 15, 50 ) & P LM lo & \textbf{4.2} $^{+1.0}_{-0.9}$ $\pm$ 1.2 & \textbf{2}\\ % P LM SR lo

& & & [ 50, $\infty$ ) & P LM hi & \textbf{2.02} $^{+0.66}_{-0.55}$ $\pm$ 0.63 & \textbf{1}\\ % P LM SR hi

& & \multirow{2}{*}{[ 1200, $\infty$ )} & [ 15, 50 ) & P LH lo & \textbf{0.19} $^{+0.26}_{-0.13}$ $\pm$ 0.13 & \textbf{0}\\ % P LH SR lo

& & & [ 50, $\infty$ ) & P LH hi & \textbf{0.06} $^{+0.14}_{-0.05}$ $\pm$ 0.03 & \textbf{0}\\ % P LH SR hi

%

& \multirow{6}{*}{$\geq 4$} & \multirow{2}{*}{[ 250, 450 )} & [ 15, 50 ) & P HL lo & \textbf{3.3} $^{+0.7}_{-0.6}$ $\pm$ 1.4 & \textbf{1}\\ % P HL SR lo

& & & [ 50, $\infty$ ) & P HL hi & \textbf{1.98} $^{+0.43}_{-0.38}$ $\pm$ 0.57 & \textbf{1}\\ % P HL SR hi

& & \multirow{2}{*}{[ 450, 1200 )} & [ 15, 50 ) & P HM lo & \textbf{4.7} $^{+0.8}_{-0.7}$ $\pm$ 1.9 & \textbf{6}\\ % P HM SR lo

& & & [ 50, $\infty$ ) & P HM hi & \textbf{2.37} $^{+0.50}_{-0.44}$ $\pm$ 0.55 & \textbf{1}\\ % P HM SR hi

& & \multirow{2}{*}{[ 1200, $\infty$ )} & [ 15, 50 ) & P HH lo & \textbf{0.43} $^{+0.24}_{-0.17}$ $\pm$ 0.27 & \textbf{0}\\ % P HH SR lo

& & & [ 50, $\infty$ ) & P HH hi & \textbf{0.17} $^{+0.10}_{-0.07}$ $\pm$ 0.04 & \textbf{0}\\ % P HH SR hi

\hline

\multirow{12}{*}{M}

& \multirow{6}{*}{2--3} & \multirow{2}{*}{[ 250, 450 )} & [ 15, 50 ) & M LL lo & \textbf{3.9} $^{+1.5}_{-1.2}$ $\pm$ 1.3 & \textbf{3}\\ % M LL SR lo

& & & [ 50, $\infty$ ) & M LL hi & \textbf{14} $^{+3.7}_{-3.2}$ $\pm$ 4.0 & \textbf{8}\\ % M LL SR hi

& & \multirow{2}{*}{[ 450, 1200 )} & [ 15, 50 ) & M LM lo & \textbf{2.1} $^{+0.89}_{-0.71}$ $\pm$ 1.1 & \textbf{3}\\ % M LM SR lo

& & & [ 50, $\infty$ ) & M LM hi & \textbf{0.68} $^{+0.90}_{-0.45}$ $\pm$ 0.35 & \textbf{4}\\ % M LM SR hi

& & \multirow{2}{*}{[ 1200, $\infty$ )} & [ 15, 50 ) & M LH lo & \textbf{0.0} $^{+0.25}_{-0.0}$ $\pm$ 0.0 & \textbf{0}\\ % M LH SR lo

& & & [ 50, $\infty$ ) & M LH hi & \textbf{0.0} $^{+0.7}_{-0.0}$ & \textbf{0}\\ % M LH SR hi

%

& \multirow{6}{*}{$\geq 4$} & \multirow{2}{*}{[ 250, 450 )} & [ 15, 50 ) & M HL lo & \textbf{1.8} $^{+0.6}_{-0.5}$ $\pm$ 0.9 & \textbf{0}\\ % M HL SR lo

& & & [ 50, $\infty$ ) & M HL hi & \textbf{2.1} $^{+0.8}_{-0.6}$ $^{+2.3}_{-2.1}$ & \textbf{2}\\ % M HL SR hi

& & \multirow{2}{*}{[ 450, 1200 )} & [ 15, 50 ) & M HM lo & \textbf{2.2} $^{+0.7}_{-0.6}$ $\pm$ 1.3 & \textbf{1}\\ % M HM SR lo

& & & [ 50, $\infty$ ) & M HM hi & \textbf{2.9} $^{+0.9}_{-0.8}$ $\pm$ 2.3 & \textbf{0}\\ % M HM SR hi

& & \multirow{2}{*}{[ 1200, $\infty$ )} & [ 15, 50 ) & M HH lo & \textbf{0.23} $^{+0.23}_{-0.13}$ $\pm$ 0.11 & \textbf{0}\\ % M HH SR lo

& & & [ 50, $\infty$ ) & M HH hi & \textbf{0.30} $^{+0.40}_{-0.20}$ $\pm$ 0.29 & \textbf{1}\\ % M HH SR hi

\hline

\hline

\multirow{4}{*}{L}

& \multirow{2}{*}{2--3} & [ 250, 1200 ) & [ 15, $\infty$ ) & L LLM  & \textbf{0.046} $^{+0.050}_{-0.034}$ $^{+0.057}_{-0.046}$ & \textbf{0}\\ % L LLM SR

&  & [ 1200, $\infty$ ) & [ 15, $\infty$ ) & L LH  & \textbf{0.015} $^{+0.036}_{-0.015}$ $\pm$ $^{+0.022}_{-0.015}$ & \textbf{0}\\ % L LH SR

& \multirow{2}{*}{$\geq 4$} & [ 250, 1200 ) & [ 15, $\infty$ ) & L HLM  & \textbf{0.092} $^{+0.136}_{-0.085}$ $^{+0.130}_{-0.092}$ & \textbf{0}\\ % L HLM SR

&  & [ 1200, $\infty$ ) & [ 15, $\infty$ ) & L HH  & \textbf{0.0} $^{+0.1}_{-0.0}$ & \textbf{0}\\ % L HH SR

\hline

\end{tabular}

\end{table}

\begin{table}[htbp]

\scriptsize
\centering

\caption[Table of 2017--2018 disappearing tracks search bins.]{Summary of the 40 signal regions of the search for disappearing tracks, for the 2017--2018 data set, together with the corresponding background predictions and observations.
For the background
predictions, the first uncertainty listed is statistical (from the limited size of control samples), and the second is systematic. The systematic uncertainty is not shown when it is negligible. Taken from \cite{MT2_2019}. \label{tab:sr2_distracks}}
\renewcommand{\arraystretch}{1.3}
\begin{tabular}{cccclcc}

\hline

Track length & \njet & \Ht range [GeV] & Track \pt [GeV] & Label & Background & Data\\

\hline

\multirow{12}{*}{P3}

& \multirow{6}{*}{2--3} & \multirow{2}{*}{[ 250, 450 )} & [ 15, 50 ) & P3 LL lo & \textbf{78} $^{+9}_{-9}$ $\pm$ 34 & \textbf{73}\\ % P3 LL SR lo

& & & [ 50, $\infty$ ) & P3 LL hi & \textbf{43.9} $^{+6.7}_{-6.2}$ $\pm$ 8.1& \textbf{41}\\ % P3 LL SR hi

& & \multirow{2}{*}{[ 450, 1200 )} & [ 15, 50 ) & P3 LM lo & \textbf{30} $^{+5}_{-5}$ $\pm$ 16 & \textbf{21}\\ % P3 LM SR lo

& & & [ 50, $\infty$ ) & P3 LM hi & \textbf{13} $^{+3}_{-3}$ $\pm$ 13 & \textbf{16}\\ % P3 LM SR hi

& & \multirow{2}{*}{[ 1200, $\infty$ )} & [ 15, 50 ) & P3 LH lo & \textbf{0.0} $^{+1.0}_{-0.0}$ & \textbf{1}\\ % P3 LH SR lo

& & & [ 50, $\infty$ ) & P3 LH hi & \textbf{0.43} $^{+0.98}_{-0.36}$ $\pm$ 0.34 & \textbf{0}\\ % P3 LH SR hi

%

& \multirow{6}{*}{$\geq 4$} & \multirow{2}{*}{[ 250, 450 )} & [ 15, 50 ) & P3 HL lo & \textbf{25.8} $^{+3.8}_{-3.4}$ $\pm$ 7.9 & \textbf{17}\\ % P3 HL SR lo

& & & [ 50, $\infty$ ) & P3 HL hi & \textbf{10.8} $^{+2.1}_{-1.8}$ $\pm$ 3.5 & \textbf{7}\\ % P3 HL SR hi

& & \multirow{2}{*}{[ 450, 1200 )} & [ 15, 50 ) & P3 HM lo & \textbf{28.9} $^{+4.0}_{-3.7}$ $\pm$ 5.7 & \textbf{37}\\ % P3 HM SR lo

& & & [ 50, $\infty$ ) & P3 HM hi & \textbf{12.3} $^{+2.2}_{-1.9}$ $\pm$ 6.8 & \textbf{11}\\ % P3 HM SR hi

& & \multirow{2}{*}{[ 1200, $\infty$ )} & [ 15, 50 ) & P3 HH lo & \textbf{3.1} $^{+1.5}_{-1.1}$ $\pm$ 0.5 & \textbf{5}\\ % P3 HH SR lo

& & & [ 50, $\infty$ ) & P3 HH hi & \textbf{0.49} $^{+0.65}_{-0.32}$ $\pm$ 0.12 & \textbf{3}\\ % P3 HH SR hi

\hline

\multirow{12}{*}{P4}

& \multirow{6}{*}{2--3} & \multirow{2}{*}{[ 250, 450 )} & [ 15, 50 ) & P4 LL lo & \textbf{24} $^{+5}_{-5}$ $\pm$ 11 & \textbf{10}\\ % P4 LL SR lo

& & & [ 50, $\infty$ ) & P4 LL hi & \textbf{4.1} $^{+1.9}_{-1.5}$ $\pm$ 3.7 & \textbf{0}\\ % P4 LL SR hi

& & \multirow{2}{*}{[ 450, 1200 )} & [ 15, 50 ) & P4 LM lo & \textbf{8.7} $^{+2.7}_{-2.2}$ $\pm$ 4.6 & \textbf{8}\\ % P4 LM SR lo

& & & [ 50, $\infty$ ) & P4 LM hi & \textbf{1.1} $^{+0.7}_{-0.5}$ $\pm$ $^{+1.4}_{-1.1}$  & \textbf{0}\\ % P4 LM SR hi

& & \multirow{2}{*}{[ 1200, $\infty$ )} & [ 15, 50 ) & P4 LH lo & \textbf{0.40} $^{+0.91}_{-0.33}$ $\pm$ 0.40  & \textbf{0}\\ % P4 LH SR lo

& & & [ 50, $\infty$ ) & P4 LH hi & \textbf{0.0} $^{+0.39}_{-0.0}$  & \textbf{0}\\ % P4 LH SR hi

%

& \multirow{6}{*}{$\geq 4$} & \multirow{2}{*}{[ 250, 450 )} & [ 15, 50 ) & P4 HL lo & \textbf{6.3} $^{+1.6}_{-1.3}$ $\pm$ 2.2  & \textbf{7}\\ % P4 HL SR lo

& & & [ 50, $\infty$ ) & P4 HL hi & \textbf{0.62} $^{+0.35}_{-0.25}$ $\pm$ 0.43  & \textbf{0}\\ % P4 HL SR hi

& & \multirow{2}{*}{[ 450, 1200 )} & [ 15, 50 ) & P4 HM lo & \textbf{6.9} $^{+1.6}_{-1.4}$ $\pm$ 6.2  & \textbf{2}\\ % P4 HM SR lo

& & & [ 50, $\infty$ ) & P4 HM hi & \textbf{1.32} $^{+0.54}_{-0.43}$ $\pm$ 0.63  & \textbf{2}\\ % P4 HM SR hi

& & \multirow{2}{*}{[ 1200, $\infty$ )} & [ 15, 50 ) & P4 HH lo & \textbf{0.42} $^{+0.56}_{-0.28}$ $\pm$ 0.12  & \textbf{0}\\ % P4 HH SR lo

& & & [ 50, $\infty$ ) & P4 HH hi & \textbf{0.08} $^{+0.18}_{-0.07}$ $\pm$ 0.03  & \textbf{0}\\ % P4 HH SR hi

\hline

\multirow{12}{*}{M}

& \multirow{6}{*}{2--3} & \multirow{2}{*}{[ 250, 450 )} & [ 15, 50 ) & M LL lo & \textbf{8.4} $^{+2.4}_{-2.0}$ $\pm$ 3.4  & \textbf{8}\\ % M LL SR lo

& & & [ 50, $\infty$ ) & M LL hi & \textbf{5.4} $^{+2.2}_{-1.8}$ $\pm$ 2.6  & \textbf{2}\\ % M LL SR hi

& & \multirow{2}{*}{[ 450, 1200 )} & [ 15, 50 ) & M LM lo & \textbf{1.90} $^{+0.85}_{-0.66}$ $\pm$ 0.92  & \textbf{6}\\ % M LM SR lo

& & & [ 50, $\infty$ ) & M LM hi & \textbf{1.12} $^{+0.77}_{-0.54}$ $\pm$ 0.97  & \textbf{1}\\ % M LM SR hi

& & \multirow{2}{*}{[ 1200, $\infty$ )} & [ 15, 50 ) & M LH lo & \textbf{0.00} $^{+0.36}_{-0}$  & \textbf{0}\\ % M LH SR lo

& & & [ 50, $\infty$ ) & M LH hi & \textbf{0.00} $^{+0.46}_{-0}$  & \textbf{0}\\ % M LH SR hi

%

& \multirow{6}{*}{$\geq 4$} & \multirow{2}{*}{[ 250, 450 )} & [ 15, 50 ) & M HL lo & \textbf{1.6} $^{+0.6}_{-0.5}$ $^{+3.0}_{-1.6}$  & \textbf{3}\\ % M HL SR lo

& & & [ 50, $\infty$ ) & M HL hi & \textbf{1.11} $^{+0.57}_{-0.42}$ $\pm$ 0.58  & \textbf{1}\\ % M HL SR hi

& & \multirow{2}{*}{[ 450, 1200 )} & [ 15, 50 ) & M HM lo & \textbf{1.9} $^{+0.6}_{-0.5}$ $^{+3.5}_{-1.9}$  & \textbf{3}\\ % M HM SR lo

& & & [ 50, $\infty$ ) & M HM hi & \textbf{1.5} $^{+0.7}_{-0.5}$ $\pm$ 1.1  & \textbf{0}\\ % M HM SR hi

& & \multirow{2}{*}{[ 1200, $\infty$ )} & [ 15, 50 ) & M HH lo & \textbf{0.38} $^{+0.31}_{-0.19}$ $^{+0.70}_{-0.38}$  & \textbf{1}\\ % M HH SR lo

& & & [ 50, $\infty$ ) & M HH hi & \textbf{0.12} $^{+0.29}_{-0.10}$ $\pm$ 0.04  & \textbf{0}\\ % M HH SR hi

\hline

\hline

\multirow{4}{*}{L}

& \multirow{2}{*}{2--3} & [ 250, 1200 ) & [ 15, $\infty$ ) & L LLM  & \textbf{0.46} $^{+0.26}_{-0.20}$ $^{+0.53}_{-0.46}$  & \textbf{0}\\ % L LLM SR

&  & [ 1200, $\infty$ ) & [ 15, $\infty$ ) & L LH  & \textbf{0.00} $^{+0.14}_{-0}$  & \textbf{0}\\ % L LH SR

& \multirow{2}{*}{$\geq 4$} & [ 250, 1200 ) & [ 15, $\infty$ ) & L HLM  & \textbf{0.013} $^{+0.015}_{-0.014}$ $^{+0.018}_{-0.013}$  & \textbf{0}\\ % L HLM SR

&  & [ 1200, $\infty$ ) & [ 15, $\infty$ ) & L HH  & \textbf{0.000} $^{+0.008}_{-0}$ & \textbf{0}\\ % L HH SR

\hline

\end{tabular}

\end{table}

max_stars_repo_name: dpgilbert/ThesisUCSD

max_issues_repo_name: dpgilbert/ThesisUCSD

max_forks_repo_name: dpgilbert/ThesisUCSD


text:
\chapter{Legal Notices}

\section{Introduction}

glscopeclient, libscopehal, and the remainder of the project are all released under the 3-clause BSD license
(reproduced below). This is a permissive license, explicitly chosen to encourage integration with third-party open
source and commercial projects.

\section{License Agreement}

Copyright (c) 2012-2020 Andrew D. Zonenberg and contributors.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met:
\begin{itemize}
\item Redistributions of source code must retain the above copyright notice, this list of conditions, and the
following disclaimer.
\item Redistributions in binary form must reproduce the above copyright notice, this list of conditions, and the
following disclaimer in the documentation and/or other materials provided with the distribution.
\item Neither the name of the author nor the names of any contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
\end{itemize}

THIS SOFTWARE IS PROVIDED BY THE AUTHORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
THE AUTHORS BE HELD LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

\section{Trademarks}

This document frequently mentions the names of various test equipment vendors and products in order to discuss
glscopeclient's compatibility with said products. The reader should assume that these are all trademarks of their
respective owners.

\section{Third Party Licenses}

TODO:
\begin{itemize}
\item yaml-cpp (shared, MIT license)
\item gtkmm (shared, LGPL)
\item FFTS (shared, BSD-3)
\item liblxi (shared, BSD-3/EPICS)
\end{itemize}

\subsection{avx\_mathfun.h (zlib license)}

AVX implementation of sin, cos, sincos, exp and log

Based on "sse\_mathfun.h", by Julien Pommier
http://gruntthepeon.free.fr/ssemath/

Copyright (C) 2012 Giovanni Garberoglio
Interdisciplinary Laboratory for Computational Science (LISC)
Fondazione Bruno Kessler and University of Trento
via Sommarive, 18
I-38123 Trento (Italy)

This software is provided 'as-is', without any express or implied
warranty.  In no event will the authors be held liable for any damages
arising from the use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

\begin{enumerate}
\item The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
\item Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
\item This notice may not be removed or altered from any source distribution.
\end{enumerate}

max_stars_repo_name: mubes/scopehal-docs

max_issues_repo_name: mubes/scopehal-docs

max_forks_repo_name: mubes/scopehal-docs


text:
\section{Introduction}
\label{sec:intro}

Nowadays, the age of the Internet has changed the way people express their opinions and views.  It is now mainly done through blog posts, online forums, product review websites, social media, etc. Millions of people are using social network sites like Facebook, Twitter, Google Plus, etc. to express their feelings, opinion and share views about their daily lives. Social media is generating a massive amount of sentiment data in the form of tweets, status updates, blog posts, comments, reviews, etc.  Therefore, It is provided an opportunity for businesses by giving a platform to connect with their customers for advertising. People mostly depend on user-generated content online to a large extent to make decisions. For example, if someone wants to buy a product or wants to use any service, they firstly search for its reviews online, discuss it on social media before making a decision. The amount of content generated by users is too large for the normal user to analyze. Therefore, it is necessary to automate this, various sentiment analysis techniques are widely used. Sentiment analysis influences users to classify whether the information about the product is satisfactory or not before they acquire it. Marketers and firms use this analysis to understand their products or services in such a way that it can be offered as per the user’s needs.

There are two types of machine learning techniques that are generally used for sentiment analysis, one is unsupervised and the other is supervised. Unsupervised learning does not consist of a category and they do not provide with the correct targets at all and therefore conduct clustering. Supervised learning is based on the labeled dataset and thus the labels are provided to the model during the process. These labeled datasets are trained to produce reasonable outputs when encountered during decision- making.

To help us to understand the sentiment analysis in a better way, this project is based on supervised machine learning. The rest of the paper is organized as follows. The second section discusses in brief about the work carried out for sentiment analysis in the different domain by various researchers. The third section is about the approach we followed for sentiment analysis. Section four is about implementation details and results followed by a conclusion and future work discussion in the last section.


text:
\chapter{Exercises}

\section{Clustering}

Open the ``Liver-cirrhosis'' data set from the \widget{Datasets} widget. It represents a sliced liver tissue. As tissues have holes and they also tear during the slicing some parts of the dataset has very low spectral intensities. Let's call these ``background regions''.

\begin{enumerate}
\item Remove background regions from the data set in any way you see fit. You are likely to need some preprocessing. Also clustering, as seen below, could be useful for for this. Try to make it work.

\vspace{-0.2cm}
\begin{figure}[h]
  \centering
  \includegraphics[width=\linewidth]{cirrhosis-background.png}%
  \caption{$\;$}
\end{figure}
\vspace{-0.3cm}

\item Afterwards, find two groups of spectra with the most obvious differences. The preprocessing used for background removal may not be the best for clustering; to obtain a selection of original data, use the \widget{Select by Data Index} widget.

\item Describe differences between the two groups. Try at least \widget{Spectra}, \widget{Distributions}, \widget{Violin Plot}, \widget{Scatter Plot}.

\end{enumerate}

\section{Classification}

\begin{enumerate}

\item Use either a spectral image or unannotated spectra. Manually annotate classes as you see fit. Assign classes only according to shapes in the image or filenames; classes set according to spectral content {\bf will} yield good separation, because that is a tautology.

\item Use Random Forests and Logistic regression. Interpret the models.

\item Observe the effects of different preprocessing on classification performance and model interpretation. Also try models built on the PCA scores.

\end{enumerate}

\section{Game of bias}

Start with a dataset with annotated classes. Randomize class values to destroy connections between spectra and classes. Next, think of a novel way to introduce bias in the data set so that AUC becomes significantly higher than 0.5 even with cross-validation within \widget{Test and Score}.

max_stars_repo_name: PrimozGodec/orange-lecture-notes

max_issues_repo_name: PrimozGodec/orange-lecture-notes

max_forks_repo_name: PrimozGodec/orange-lecture-notes


text:
\documentclass[a4paper,man,natbib]{apa6}
\usepackage[english]{babel}

\usepackage[cache=false]{minted}
\usemintedstyle{vs}
\usepackage{xcolor}
\definecolor{bg}{rgb}{.95,.95,.95}

\graphicspath{ {./images/} }
\usepackage{graphicx}
\usepackage{caption}
\usepackage{ulem}

\usepackage{setspace}
%\usepackage{titlesec}
%\titleformat{\subsection}[runin]% runin puts it in the same paragraph
%	{\normalfont\bfseries}% formatting commands to apply to the whole heading
%	{\thesubsection}% the label and number
%	{0.5em}% space between label/number and subsection title
%	{}% formatting commands applied just to subsection title
%	[]% punctuation or other commands following subsection title
% End Packages %

\title{Advanced Statistical Methods Homework 7}
\shorttitle{DAT 530 HW7}
\author{Brandon Hosley}
\date{\today}
\affiliation{University of Illinois - Springfield}
%\abstract{}

\begin{document}
\maketitle
\singlespacing

\section{Introduction to Statistical Learning \\ Chapter 8.4 : Problem 12}
\normalem
\emph{Apply \sout{boosting, bagging,} and random forests to a data set of your
	choice. Be sure to fit the models on a training set and to evaluate their
	performance on a test set. How accurate are the results compared
	to simple methods like linear or logistic regression? Which of these
	approaches yields the best performance?} \vspace{1em}

Prepare the data set:

\begin{minted}[bgcolor=bg]{r}
library(MASS)
attach(Boston)
library(randomForest)
set.seed(1234)
\end{minted}

With the Boston dataset we will train a random forest.

\begin{minted}[bgcolor=bg]{r}
train = sample(1:nrow(Boston), nrow(Boston)/2)
test=Boston[-train ,"crim"]
rf.boston= randomForest(crim~.,data=Boston , subset=train,
	mtry=6, importance =TRUE)
yhat.rf = predict(rf.boston ,newdata=Boston[-train ,])
mean((yhat.rf-test)^2)
\end{minted}
\vspace{-1em}
\begin{minted}[bgcolor=bg]{r}
Out: 49.66785
\end{minted}

The Mean-Squared error provided by the Random Forest model is comparable but slightly worse than the MSE given by the Lasso and Ridge Regression models in Module 6. \\
While the performance is slightly behind those other methods it is still better than simple linear or logistic regression models, as seen in Module 3. \\

\end{document}

max_stars_repo_path: 2020-Fall Advanced Statistical Methods/HW 07/HW 07.2_Hosley.tex

max_stars_repo_name: bhosley/Schoolwork

max_issues_repo_name: bhosley/Schoolwork

max_forks_repo_name: bhosley/Schoolwork


text:
\documentclass[11pt,fancy,authoryear]{elegantbook}

\title{C++ in Detail}
\subtitle{An in-depth guide to C++ on x86 systems with GCC}

\author{Nick Green}
\institute{CoffeeBeforeArch}
\date{December 31, 2020}
\version{0.0}
%\bioinfo{Bio}{Information}

%\extrainfo{Victory won\rq t come to us unless we go to it. }

%\logo{logo-blue.png}
\cover{cover.jpg}

\begin{document}

\maketitle

\frontmatter
\tableofcontents

\mainmatter

\chapter{Introduction}

From databases and web browsers to operating systems and compilers, C++ can be found almost everywhere. This along with a incredibly active community makes it a great time to start learning C++!

\section{Why This Book on C++?}

Out of all the great books on C++, why should you pick this one? Here is a list of reasons!

\begin{itemize}
  \item \textbf{It's free:} This is book (and its source) will always be free to download
  \item \textbf{It can be updated:} Printed books can not be updated. With a digital book, I can make modifications as new standards of C++ get approved, or correct errors in the text.
  \item \textbf{It fills in a gap left by other books:} Many entry level books focus solely on the C++ language, and avoid talking about implementation-specific details. This book breaks this mold by discussing these details which can be increadibly imprortant in practice.
\end{itemize}

\section{Intended Audience}

This book was written as a companion piece to my YouTube series \textbf{C++ Crash Course}. As such, the intended audience is expected to have no prior background in C++ programming.

Having some knowledge of basic programming concepts (e.g., types, functions, etc.) would be useful.

\section{Environment}

\begin{itemize}
  \item \textbf{Operating System: } Ubuntu 20.04
  \item \textbf{Compiler: } GCC 10.2
  \item \textbf{Processor: } Intel x86\-64
\end{itemize}

\section{About the Author}

My name is Nick, and I'm a computer systems architect working on deep learning accelerator performance in the San Francisco Bay Area.

My start in programming came during my undergraduate degree in electrical engineering where I took \textit{Engineering Programming with C}. While I enjoyed this course, I did not take any more dedicated programming classes during this degree (although I did some basic MATLAB and Python programming as required by various coursework).

My start with C++ came during my Ph.D. (incomplete), where I used and developed the GPGPU architecture simulator, GPGPU-Sim. This simulator (largely written in C++), was where I spent a large portion of my time.

After approximately one year of writing C-like C++, I decided to take C++ programming more seriously. There was no single book or resource I used to learn the language. Instead, I would run across a piece of C++ I didn't understand (something like a container or template), search the internet to see out how it worked, then write a minimal example to solidify my understanding. These minimal examples are what eventually became my YouTube series \textbf{C++ Crash Course}.

From then on, C++ and high performance software became one of my passions. I began writing benchmarks in C++, writing blog posts, and doing teaching livestreams.

\chapter{Foundation}

Before we dive into code samples, we need to first discuss some of the foundational parts of C++. This includes the compiler, type system, and functions. It is important to start our journey here, because the compiler, types, and functions play a role in every C++ program.

\section{The Compiler}

Processors can not directly read/execute high-level C++ code. It first must be translated into the instructions that the processor can understand (the processor's instruction set). This is done with another program known as the compiler.

The purpose of the compiler is to translate code in some source language into a target language. For the majority of examples in this book, we will focus on using the compiler to translate source code written in C++, to machine code that can execute on an x86 processor.

\section{The C++ Type System}

At the lowest level, every part of a program (from the instructions to the data) is composed of bits. How we interpret those bits is determined by types. Types in C++ fall into two categories: fundamental types, and compound types.

\subsection{Fundamental Types}

Fundamental types (sometimes referred to as built-in types) are those types are are built into the compiler, and do not require the inclusion of any other source files to use. These can be broken into the void type, integral types, and floating-point types.

\subsubsection{The Void Type}

Void is a type with an empty set of values. This means that no value can be of the void type. As no value can be of type void, what is it used for?

In practice, void is used to express a lack of data (e.g., to express no data is returned from or passed to a function).

\subsubsection{The Boolean Type}

The boolean type, \lstinline{bool}, is capable of holding one of two values: \lstinline{true} and lstinline{false}.

\subsubsection{Integral Types}

Integral types are used to represent whole numbers that can be either signed (positive or negative) or unsigned (only positive). The basic form of this type is the \lstinline{int}.

\subsubsection{Floating-Point Types}

Floating-point types are used to represent decimal numbers according to the IEEE-754 floating point standard. The two core types in this category are \lstinline{float} (32-bits) and \lstinline{double} (64-bits).

\subsection{Compound Types}

All types that are not categorized as fundamental are considered to be compound types. According to the C++ standard, compound types can be constructed in the following ways:

\begin{itemize}
  \item Arrays of objects of a given type
  \item Functions which have parameters of given types and return void or references or objects of a given type
  \item Pointers to cv void or objects or functions (including static members of classes) of a given type
  \item References to objects or functions of a given type
  \item Classes
  \item Unions
  \item Enumerations
  \item Pointers to non-static class members
\end{itemize}

Two intuitive ways we can think about compound types are based on where the type comes from, and what they are made of. Compound types are often user-defined (i.e. not built into the compiler). For example, we can make custom types using structs and classes.

Compound types are also typically built on other types. For example, \lstinline{int} is a fundamental type, but when we take the address of that integer (where it exists in memory), we get a pointer to an integer (a compound type, based on the fundamental type \lstinline{int}).

\section{Functions}

Functions allow us to associate a name with a sequence of statements. In this section, we'll be looking at the basic structure of functions in C++, and the special case of functions called \lstinline{main}.

\subsection{Core Parts of Functions}

At their core, a function has four parts:

\begin{itemize}
  \item A return type - The type of value returned by the functions
  \item A name - Used as an identifier for the function
  \item A comma-separated parameter list - The types and names of values we want to pass to the function
  \item A function body - The set of statements this function executes
\end{itemize}

Here is a simple function we can use as an example:

\begin{lstlisting}[language=C++]
int myFunction(int a) {
  return a;
}
\end{lstlisting}

If we break this down into the core parts of the function, we have:

\begin{itemize}
  \item The return type - \lstinline{int}
  \item The name - \lstinline{myFunction}
  \item The parameter \lstinline{int a}
  \item The function body \lstinline{return a;}
\end{itemize}

\subsection{The Main Function}

Every program in both C and C++ requires a function named \lstinline{main}. The \lstinline{main} function is special because it is the entry point for our program (where execution begins when we run our executable). It also comes in two signatures.

The first function signature is what we will primarily use in this book:

\begin{lstlisting}[language=C++]
int main() {
  return 0;
}
\end{lstlisting}

This version of \lstinline{main} returns an \lstinline{int} and does not take any arguments. The return value from \lstinline{main} (\lstinline{0} in this case) is used to signal that our program completed successfully (with a non-zero value meaning some sort of error occured). \lstinline{main} is also unique in the fact that we can omit the \lstinline{return} statement from our function, and it will by defualt perform \lstinline{return 0;}.

The second form of \lstinline{main} is when we want to pass input values to our program:

\begin{lstlisting}[language=C++]
int main(int argc, char *argv){
  return 0;
}
\end{lstlisting}

The only major difference in this form of \lstinline{main} is that it has two parameters:

\begin{itemize}
  \item \lstinline{int argc} - The number of arguments
  \item \lstinline{char *argv[]} - The arguments stored as strings in an array
\end{itemize}

For the majority of this series we will be using the first form of the \lstinline{main} function.

\chapter{Basics}

Before we can write complex software, we have to master the basics. In this chapter, we will cover writing, compiling and executing C++ code, the classical "Hello world!" example, and how to work with variables in C++.

\begin{introduction}
  \item Basic C++
  \item Hello World!
  \item Working with Variables
\end{introduction}

\section{Basic C++}

\subsection{The Most Simple C++ Program}

The most simple program we can write in C++ is a one that does absolutely nothing! For this we us an empty \lstinline{main} function.

\begin{lstlisting}[language=C++]
int main() {
  return 0;
}
\end{lstlisting}

\subsection{Compiling our Program}

Now that we have a fully formed C++ program, we need to turn it into something that we can execute. In this book, we'll be using the GNU Compiler Collection (GCC), and the compiler driver g++.

As a compiler driver, g++ drives each step of translating our high-level C++ into an executable.

\subsection{Executing our Program}

Now that we have an executable, we need to execute (run) our program.

\section{Hello World!}

Now that we know how to write, compile, and run a basic C++ program, we can start looking at more interesting programs. The first of these will be the classical "Hello, world!" program. This program prints the string "Hello, world!" to the console.

\begin{lstlisting}[language=C++]
// Prints "Hello, World!" to the console using cout
// By: Nick from CoffeeBeforeArch

// Pastes the contents of file(s) where #include is located
#include <iostream>

// All C++ program require a main functions (entry point to the program)
int main() {
  // Pass "Hello, World!" to the cout stream object
  std::cout << "Hello, World!\n";

  // Return 0 typically means we did not encounter an error
  return 0;
}
\end{lstlisting}

Lets's take some time deconstructing each part of this program.

\subsection{Comments}

Comments are lines of source code that have no impact on execution because they are ignored by our compiler. We typically use comments for two purposes:

\begin{enumerate}
  \item Documentation
  \item Temporarily disabling code
\end{enumerate}

Documentation helps make software easier to reason about. For example, comments about what a function or snippet of code can save programmers the time of having to read the entire function or snippet. Within collaborative projects, comments about who the code-owner/author make it easier to identify who to seek help from

In addition to documentation, temporarily disabling code can be useful when testing/debugging. There may be situations where we want to temporarily disable code but not delete it. Comments allow us to keep the text in the file, and tell the compiler to ignore it.

There are two ways we can write comments in C++:

\begin{enumerate}
  \item Single-line comments
  \item Block comments
\end{enumerate}

Single-line comments begin with two slashes (\lstinline{//}). Any code after the two slashes and to the end of the line will be ignored by the compiler. Our first two lines of our program are an example of this:

\begin{lstlisting}[language=C++]
// Prints "Hello, World!" to the console using cout
// By: Nick from CoffeeBeforeArch
\end{lstlisting}

Block comments allow us to comment out multiple lines without haveing to add two slashes to every line. The start of our block comment begins with \lstinline{/*}, and ends with \lstinline{*/}. Everything between these two markers will be ignored by the compiler. For example, we can re-write our comments at the top of our program as follows:

\begin{lstlisting}[language=C++]
/*
Prints "Hello, World!" to the console using cout
By: Nick from CoffeeBeforeArch
*/
\end{lstlisting}

\subsection{Include Statements and the Standard Library}

One key thing we want to avoid when programming is reinventing the wheel. One of the best ways we can do this is by making use existing libraries. One of the most important libraries in C++ is the C++ Standard Library.

The C++ Standard Library is a collection of containers, algorithms, and utilities that are part of the C++ Language Standard. However, before we can use them in our program, we must tell the compiler (more specifically the preprocessor) to fetch relevant source files. We do this through include statements.

\subsection{The cout Stream Object and Namespaces}

\subsection{Compiling and Running}

\section{Working with Variables}

Variables allow us to associate a piece of memory with a name. Defining a variable requires two parts:

\begin{enumerate}
  \item A Type
  \item A Name
\end{enumerate}

A variable's type determines how much memory will be reserved, where it can be placed in memory (its alignment), and how we can interact with that piece of memory (e.g., what operations we can perform).

The name of our variable is simply how we refer to it in our program. The name of a variable can be \textit{almost} anything. Below are the rules about variable names:

\begin{itemize}
  \item Variables names must be within 1 and 255 characters
  \item Variables must begin with a letter or underscore
  \item After the first character, the remaining characters can be letters, numbers, or underscores
  \item Variable names are case sensative
  \item Reserved words (e.g., \lstinline{return}) can not be used as a variable name
\end{itemize}

In addition to these rules, variable names may not be repeated in the same scope (curly brackets).

\chapter{Control Flow}

We don't always want to execute every line of code in our program. We often want to execute different portions of code based on values in our program. For this, we can use conditional statements, loops, and functions.

\begin{introduction}
  \item Conditional Statements
  \item Loops
  \item Functions
\end{introduction}

\section{Conditional Statements}

\subsection{If and Else Satements}

\subsection{Switch Statements}

\section{Loops}

\subsection{For Loops}

\subsection{While and Do-While Loops}

\section{Functions}

\subsection{Basics}

\subsection{Overloading}

\subsection{Templates}

\chapter{Memory}

\section{Pointers and References}

\section{Dynamic Memory Allocation}

\chapter{Objects}

\section{Classes and Structs}

\subsection{Constructors}

\subsection{Destructors}

\subsection{Copy Constructors}

\subsection{Operators}

\section{Templates}

\section{Inheritance}

\section{Polymorphism}

\chapter{STL Containers and Algorithms}

\end{document}