Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
381 lines (307 sloc) 10.1 KB
\documentclass[12pt,oneside]{article}
\usepackage{
amsmath,
amsthm,
amssymb,
fancyhdr,
setspace,
}
\usepackage{color}
\usepackage{algorithm2e}
\usepackage{algorithmic}
%\usepackage{algorithm}
%\usepackage[noend]{algpseudocode}
\usepackage{float}
\usepackage{graphicx}
\usepackage{multicol}
%\usepackage{lstlisting}
%\usepackage{algorithmicx}
%\usepackage{listings}
%\usepackage{caption}
%\newcounter{nalg}[section] % defines algorithm counter for chapter-level
%\renewcommand{\thenalg}{\thesection .\arabic{nalg}} %defines appearance of the algorithm counter
%\DeclareCaptionLabelFormat{algocaption}{Algorithm \thenalg} % defines a new caption label as Algorithm x.y
%\lstnewenvironment{algorithm}[1][] %defines the algorithm listing environment
%{
% \refstepcounter{nalg} %increments algorithm number
% \captionsetup{labelformat=algocaption,labelsep=colon} %defines the caption setup for: it ises label format as the declared caption label above and makes label and caption text to be separated by a ':'
% \lstset{ %this is the stype
% frame=tB,
% numbers=left,
% numberstyle=\tiny,
% basicstyle=\scriptsize,
% keywordstyle=\color{black}\bfseries\em,
% keywords={,input, output, return, datatype, function, in, if, else, foreach, while, begin, end, } %add the keywords you want, or load a language as Rubens explains in his comment above.
% numbers=left,
% xleftmargin=.04\textwidth,
% #1 % this is to add specific settings to an usage of this environment (for instnce, the caption and referable label)
% }
%}
%{}
%redundant \usepackage{amsmath}
%\makeatletter
%\def\BState{\State\hskip-\ALG@thistlm}
%\makeatother
%requires XeTeX or LuaTeX \usepackage{fontspec}
%\setmainfont{Hoefler Text}
%\newcommand*\DNA{\textsc{dna}}
%\newcommand*\Let[2]{\State #1 $\gets$ #2}
%\algrenewcommand\alglinenumber[1]{
% {\sf\footnotesize\addfontfeatures{Colour=888888,Numbers=Monospaced}#1}}
%\algrenewcommand\algorithmicrequire{\textbf{Precondition:}}
%\algrenewcommand\algorithmicensure{\textbf{Postcondition:}}
\begin{document}
Product:
an assessment list of questions for incoming to discrete math
%\begin{enumerate}
%\item Matching symbolic representations (i.e., equations in figures) with algorithms in pseudocode:
%Stick breaking:\\
%Start with a unit length.\\ % stick.\\
%This unit serves as "what is in stock".\\
%Every time a fractional part is required, a random fraction of the remaining %stock is taken.// %the stick is broken, one piece will be provided as output of the process, and the remainder will be held for future breaking.\\
%When it is desired to have $p$ fractions, adding to length 1, $p-1$ iterations will satisfy this.\\
\begin{figure}[ht]
\centering
\includegraphics[width=0.7
\linewidth]{./pic8}
\caption{Equation (1)}
\end{figure}
\begin{figure}[ht]\centering
\[
\sum_{i=0}^k \frac{1}{2^i}
\]
\caption{Equation (2)}
\end{figure}
% \begin{algorithm}[H]
% factorization(n)\;
% \KwData{an integer $\geq 2$, which becomes bound to the variable n}
% \KwResult{a prime factorization of n}
% \eIf{$prime(n)$}{
% return n
% }{
% (factor1, factor2) = getFactors(n)\;
% return factorization(factor1) $\times$ factorization(factor2)
% }
% \caption{pseudocode for obtaining factorization }
% \end{algorithm}
\begin{multicols}{2}
\begin{algorithm}[H]
\caption{ }
\begin{algorithmic}[1]
%\IF{$A \rightarrow false$}
%\STATE $A = false$\\
%\ENDIF
\STATE num = rand()*10;\\
\STATE stock = 1;\\
\STATE amount = 0;\\
\STATE frac = 1/2;\\
getRandomFraction()
\WHILE{num $>0$}
\STATE{stock = stock*frac;
\STATE amount = stock+amount;\\
\STATE num = num-1;\\
} \ENDWHILE
return amount;\\
\}
\end{algorithmic}
\end{algorithm}
\columnbreak
\begin{algorithm}[H]
\caption{ }
\begin{algorithmic}[1]
%\IF{$A \rightarrow false$}
%\STATE $A = false$\\
%\ENDIF
\STATE num = rand()*10;\\
\STATE stock = 1;\\
\STATE amount = 0;\\
\STATE frac = 1/2;\\
getRandomFraction()
\STATE frac=rand(); \\
\STATE amount = stock*frac;\\
\STATE stock = stock - amount;\\
return amount;
\end{algorithmic}
\end{algorithm}
\end{multicols}
Circle your choice:\\
Equation 1 goes with Algorithm 1? Yes, No\\
Equation 1 goes with Algorithm 2? Yes, No\\
Equation 2 goes with Algorithm 1? Yes, No\\
Equation 2 goes with Algorithm 2? Yes, No\\
\newpage
%\item Matching figures/diagrams with symbolic representations\\
Show which equation goes with which diagram, if they can be matched.
\begin{enumerate}
\item \begin{figure}[ht]
\centering
\includegraphics[width=0.7\linewidth]{./pic2GNUPaint}
\caption{}
\label{fig:pic2}
\end{figure}
\item \begin{figure}[ht]
\centering
\includegraphics[width=0.7\linewidth]{./pic4}
\caption{}
\label{fig:pic4}
\end{figure}
\end{enumerate}
\begin{enumerate}
\item $b^2 + ab = (b+a/2)^2 - (a/2)^2$
\item $(a+b)^2 + (a-b)^2 = 2(a^2 + b^2)$
\end{enumerate}
Circle your choice:\\
Equation (a) goes with Figure 3? Yes, No\\
Equation (b) goes with Figure 3? Yes, No\\
Equation (a) goes with Figure 4? Yes, No\\
Equation (b) goes with Figure 4? Yes, No\\
\newpage
%\item Matching figures/diagrams with pseudocode
%\begin{enumerate}
\begin{figure}
\centering
\includegraphics[width=0.6\linewidth]{./pic9}
\caption{First}
\label{fig:pic9}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=0.6\linewidth]{./pic10GNU}
\caption{Second}
\label{fig:pic10}
\end{figure}
\begin{multicols}{2}
\begin{algorithm}[H]
\caption{ }
\begin{algorithmic}[1]
\STATE amount = 1;\\
getAmount(n)\{\\
\STATE amount = 0;
\FOR{$i=0$ to $n$}
\STATE \FOR{$j=0$ to $i$}
\STATE amount = amount +j;
\ENDFOR
\ENDFOR\\
return amount;\}
\end{algorithmic}
\end{algorithm}
\columnbreak
\begin{algorithm}[H]
\caption{ }
\begin{algorithmic}[1]
\STATE amount = 1;\\
getAmount(n)\{\\
\IF{$n=0$}
\STATE return (1)
\ELSE
\STATE return(2*getAmount(n-1)+1)
\ENDIF\\
\}
\end{algorithmic}
\end{algorithm}
\end{multicols}
\newpage
Circle your choice:\\
Figure 5 goes with Algorithm 3? Yes, No\\
Figure 5 goes with Algorithm 4? Yes, No\\
Figure 6 goes with Algorithm 3? Yes, No\\
Figure 6 goes with Algorithm 4? Yes, No\\
%\item
%\item
%\end{enumerate}
%\newpage
%\item Comprehending figures\\
%Explain why the figure matches the equation $\frac{a+b}{2} \geq \sqrt{ab}$ with equality if and only if $a=b$
%\begin{figure}
%\centering
%\includegraphics[width=0.7\linewidth]{./pic5}
%\caption{}
%\label{fig:pic5}
%\end{figure}
\newpage
%\item Comprehending symbolic representation\\
Describe in text what this symbolic statement means:\\
\[
\sum_{ k \in \mathbb{N}}^{\infty} (2k+1)
\]
\newpage
%\item Comprehending pseudocode
Describe in text, what this process is doing:\\
Challenge question: What is the significance of the process described by this pseudocode?
\begin{algorithm}[H]
\caption{ }
\begin{algorithmic}[1]
\STATE done = false;\\
\STATE a = 0;\\
\STATE b = 0;\\
\STATE c=0;\\
\STATE n = 2;\\
\WHILE{!done}
\STATE{ \WHILE{$a\geq 0$}
\STATE{ a=a+1;
\WHILE{$b \geq0$}
\STATE{ b=b+1;
\WHILE{$c \geq 0$}
\STATE{ c=c+1;\\
\WHILE{$n \geq 0$}
\STATE{ n=n+1;\\
\IF{$a^n +b^n = c^n$}
\STATE done = true;
\ENDIF\\
} \ENDWHILE
} \ENDWHILE\\
} \ENDWHILE\\
} \ENDWHILE
} \ENDWHILE
\end{algorithmic}
\end{algorithm}
\newpage
Applying symbolic representation to figure
Label these figures mathematical symbols:\\
Challenge question: What is the significance of these figures taken together?
\vspace{1cm}
\begin{figure}[ht]
\centering
\includegraphics[width=0.7\linewidth]{./pic1}
\caption{}
\label{fig:pic1}
\end{figure}
\newpage
Applying figure to symbolic representation
Draw a figure that expresses:\\
Through any three points that are not collinear, two can be used to identify a line, and the third can be used, combined with that line, to identify a line parallel to the first line.
\newpage
Applying pseudocode to figure
Write pseudocode (e.g., as has been seen earlier in these questions) to count the little squares, according to the method suggested by the shading in the figure: \\
Hint: the bottom row could be row 1.\\
$n$ and $k$ could be parameters.\\%(p. 93)\\
Look at the shading to imagine the figure as expanding upwards and rightwards.\\
Consider how many new squares are added, as an alternately shaded region is incorporated.\\
Challenge question: If the light region of row 1 contains an odd number of little squares, does every successive region (by shading) contain an add number of little squares?
\begin{figure}[ht]
\centering
\includegraphics[width=0.7\linewidth]{./p93}
\label{fig:p93}
\end{figure}
\newpage
Applying pseudocode to symbolic representation
Write pseudocode for the calculation below:\\
Hint: ${ n \choose k} $ means, from a set of size $n$ choose (without replacement) $k$ elements.\\
For example, from a list of friends of size $n$, choose a list of party guests of size $k$. (Without replacement means, you do not send two invitations to the same friend.)
Please say whether the concrete example (friends, guest list) aided your thinking.
${ n \choose k} = {n-1 \choose k-1}+ {n-1 \choose k}$
\newpage
Synthesis: word problems to figures
Draw a figure for this word problem:\\
Pick an angle between 0 and $\pi/2$ radians, call it $\theta$.\\
A right triangle can be drawn, the height of which is 1 plus the tangent of $\theta$, the base of which is 1 plus the cotangent of $\theta$. The angle $\theta$ is adjacent to the base. It will be the case that the hypotenuse of this triangle is the cosecant of $\theta$ plus the secant of $\theta$.
\newpage
Synthesis: word problems to representation as a mathematical expression using letter symbols (e.g., $\sqrt{(b^2 - 4 a c)}$)\\
Express in such symbols this word problem:\\
The number of moves in a game of size n is given by twice the number of moves in a game of size (n-1), plus one more move.
\newpage
Synthesis: word problems to pseudocode
Write pseudocode for this word problem:\\
Two trains, initially 40 miles apart on the same track, going opposite directions, are getting closer to each other at the rate of 40 miles per hour. An insect flies from one train to the other and back, at a constant speed of $v$, repeatedly. How far does the insect fly, before the trains collide?
%\end{enumerate}
\end{document}
You can’t perform that action at this time.