\documentclass[11pt]{article}
\usepackage{graphicx}
\usepackage{amssymb,amsmath,float,subfig}
\usepackage[top=0.5in,bottom=0.5in,left=0.75in,right=0.75in]{geometry}
%\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png}
\parskip = 0.1in
\parindent = 0.0in
\pagestyle{empty} \everymath={\displaystyle}

\usepackage[backend=biber]{biblatex}
\addbibresource{PS3 S19 - Sorice.bib}


\begin{document}

\begin{center}
{\large{\textbf{\underline{MAT 2270: Problem Set 3}}}} \\ Mike Sorice
\end{center}

\begin{enumerate}

    \item \textit{There are infinitely many quadratic expressions of the form $y=ax^{2} + bx + c$. But what percent of those are factorable over the integers when $a$, $b$, and $c$ are each \underline{nonzero} integers from -10 to 10? Generate 25 random quadratic expressions of this type and determine what percentage are factorable.}

    For notational convenience, let: $$C = \{ c \in \mathbb{Z}: |c| \le 10 \land c \ne 0 \} = \{-10.-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10\}$$ and let:
    $$\mathcal{P} = \{ ax^2 + bx + c: (a,b,c) \in C^3 \}.$$ Table \ref{table:fact} shows factorability over $\mathbb{Z}$ for a random sample of 25 polynomials from $\mathcal{P}$. See \texttt{PS3-1-Sorice.ggb} for computations.
    
    \begin{table}[ht]
        \centering
        \begin{tabular}{|c|c|c|c|}
        \hline
        Polynomial	&	Output of \texttt{Factor}	&	Factorable Over $\mathbb{Z}$?	&	Discriminant	\\ [0.5ex]
        \hline
        $-3x^2-2x+4$	&	$-3x^2-2x+4$			&	No						&	$52$			\\ %1
        $-9x^2+2x-4$	&	$-9x^2+2x-4$			&	No						&	$-140$		\\ %2
        $6x^2-2x-6$	&	$2(3x^2-x-3)$			&	No						&	$148$		\\ %3
        $4x^2+6x-9$	&	$4x^2+6x-9$			&	No						&	$180$		\\ %4
        $-9x^2-x-3$	&	$-9x^2-x-3$			&	No						&	$-107$		\\ %5
        $3x^2-7x+6$	&	$3x^2-7x+6$			&	No						&	$-23$		\\ %6
        $7x^2+10x+7$	&	$7x^2+10x+7$			&	No						&	$-96$		\\ %7
        $-3x^2+6x+10$	&	$-3x^2+6x+10$			&	No						&	$156$		\\ %8
        $-9x^2-x-1$	&	$-9x^2-x-1$			&	No						&	$-35$		\\ %9
        $-9x^2-7x+2$	&	$-(x+1)(9x-2)$			&	Yes						&	$121=11^2$	\\ %10
        $9x^2+7x-7$	&	$9x^2+7x-7$			&	No						&	$301$		\\ %11
        $-3x^2+3x+6$	&	$-3(x-2)(x+1)$			&	Yes						&	$81=9^2$		\\ %12
        $9x^2+7x+6$	&	$9x^2+7x+6$			&	No						&	$-167$		\\ %13
        $8x^2+9x-6$	&	$8x^2+9x-6$			&	No						&	$273$		\\ %14
        $-x^2-x+6$	&	$-(x-2)(x+3)$			&	Yes						&	$25=5^2$		\\ %15
        $-6x^2+3x-8$	&	$-6x^2+3x-8$			&	No						&	$-183$		\\ %16
        $7x^2-x+10$	&	$7x^2-x+10$			&	No						&	$-279$		\\ %17
        $10x^2+2x+7$	&	$10x^2+2x+7$			&	No						&	$-276$		\\ %18
        $9x^2+6x-4$	&	$9x^2+6x-4$			&	No						&	$180$		\\ %19
        $5x^2-5x+5$	&	$5(x^2-x+1)$			&	No						&	$-75$		\\ %20
        $-8x^2-3x-1$	&	$-8x^2-3x-1$			&	No						&	$-23$		\\ %21
        $-8x^2-2x-6$	&	$-2(4x^2+x+3)$			&	No						&	$-188$		\\ %22
        $-3x^2-4x+7$	&	$-(x-1)(3x+7)$			&	Yes						&	$100=10^2$	\\ %23
        $4x^2-9x-8$	&	$4x^2-9x-8$			&	No						&	$209$		\\ %24
        $-6x^2-8x+3$	&	$-6x^2-8x+3$			&	No						&	$136$		\\ %25
        \hline
        \end{tabular}
        \caption{Factorability over $\mathbb{Z}$ for 25 random\textsuperscript{a} quadratics from $\mathcal{P}$.}
        \small\textsuperscript{a: Generated by \emph{GeoGebra} computer algebra system (C.A.S.) \texttt{RandomPolynomial(2,-10,10)} with polynomials having any zero coefficient discarded.}
        \label{table:fact}
    \end{table}

    \begin{enumerate}

        \item \textit{What does it mean when we say a quadratic expression is \emph{factorable}? }

            A quadratic is factorable if and only if it can be written as the product of two linear terms with coefficients from some factor domain. The latter rightly should be specified, but there is a regrettable tendency to use ``factorable" without specifying the factor domain, in which case it is often $\mathbb{Z}$ or $\mathbb{Q}$.

        \item \textit{What domain (by default) does \emph{GeoGebra} factor over?}
            
            It factors over $\mathbb{Z}$. The output of \texttt{Factor}$\left[ \left( x+ \frac 1 2 \right)^2 \right]$ is $\frac{(2x+1)^2}{4}$ and not $\left( x + \frac 1 2 \right)^2,$ for instance.
            
        \item \textit{How many possible quadratic expressions are there with non-zero integer coefficients from -10 to 10?}
            
            $\# C = 20$. Each polynomial in $\mathcal{P}$ has $3$ independent coefficients. Therefore, $\# \mathcal{P} = 20^3 = 8000.$
            
        \label{disc} \item \textit{What has to be true about the discriminant of a quadratic expression for it to be factorable over the integers?}
            
            Consider a quadratic $f(x)$: 
            $$f(x) = ax^2+bx+c, a \ne 0.$$ Its discriminant is: 
            $$d = b^2-4ac$$ so that its roots are: 
            $$\frac{-b \pm \sqrt{d}}{2a}.$$
            Its factored form is thus: 
            $$f(x) = a \left( x + \frac{b+\sqrt{d}}{2a} \right) \left( x + \frac{b-\sqrt{d}}{2a} \right) = \frac{(2ax+b+\sqrt{d}) (2ax+b-\sqrt{d})}{4a} ,$$
            which will be a factorization over the integers if and only if $(a,b,\sqrt{d}) \in \mathbb{Z}^3$. As all the polynomials in $\mathcal{P}$ have integer coefficients, the restriction there is reduced to $d = b^2-4ac$ being the square of some integer. This is borne out by the ``Discriminant" column in Table \ref{table:fact}.

        \label{pct} \item  \textit{What percentage did you obtain?}
        
            $\hat{p} = 4 \div 25 = 16\%$ of the sample of $\mathcal{P}$ used to generate Table \ref{table:fact} factors over $\mathbb{Z}$.
            
         \textit{How confident are you in your percentage? Explain.}
             
             To generate $\hat{p}$, a random sample of $n_0=25$ polynomials was taken from a finite population of $N= \# \mathcal{P} = 8000.$ $\hat{p}_0$ is the best available estimate of the population proportion $p,$ i.e. the true percentage of polynomials from $\mathcal{P}$ that factor over $\mathbb{Z}.$ Thus, $n_0p \approx n_0 \hat{p}_0 = 4.$ With the best estimate for $n_0p$ less than $10$ and $n_0=25<30,$ these data are not suitable for making inferences, as the sampling distribution of the proportion isn't well characterized until $(np > 10) \land [n(1-p) > 0] \land (n>30)$ \autocite[269]{freund}. Therefore, one can't be very confident that $\hat p$ is a good estimate of $p.$
             
             To fix this issue, the experiment was repeated for $200$ more random polynomials from $\mathcal{P}$, $25$ of which were factorable. This produces a better estimate of the proportion: 
             $$\hat{p} = \frac{25+4}{200+25} \doteq 0.129.$$ 
             The data now satisfy all criteria for approximate normality of the sampling distribution of the proportion:
             $$(n p \approx n \hat{p} = 29 \ge 10) \land [n (1-p) \approx n (1-\hat{p}) = 196 \ge 10] \land (n = 225 > 30).$$
             Therefore, $\hat{p}$ has a standard error \autocite[271-272]{freund}:
             $$\sigma_{\hat{p}} = \sqrt{\frac{p(1-p)}{n} \frac{N-n}{N-1}} \approx \sqrt{\frac{\hat{p}(1-\hat{p})}{n} \frac{N-n}{N-1}} \doteq 0.022.$$ 
             Using this, we can state with $95\%$ confidence \autocite[362-364]{freund} that:
             $$ \hat{p} - \sigma_{\hat{p}}  z_{0.025}\footnote{$z_{0.025} = \sqrt 2 \text{ erf}^{-1}(0.95) \doteq 1.96.$}  \approx 8.6 \% < p < 17.2 \% \approx \hat{p} + \sigma_{\hat{p}} z_{0.025}.$$
             
         \textit{Does this seem like a high or a low number? Explain.}
             
             By Part \ref{disc}, a polynomial from $\mathcal{P}$ is factorable over $\mathbb{Z}$ if and only if its discriminant is a square. Discriminants in $\mathcal{P}$ are integers ranging from $-400 = 0^2 - 4 \times 10 \times 10$ to $500 = 10^2 + 4 \times 10 \times 10.$ That range contains the squares up to $22^2 = 484,$ on which basis the proportion of $\mathcal{P}$ factorable over $\mathbb{Z}$ can be very grossly estimated as $\hat{p}' \sim 22 \div 900 \doteq 2.4 \%.$
             
             In light of $\hat{p}'$, $\hat{p} = 12.9 \%$ seems high. On the contrary, however, it is highly certain that $p > 8.6 \% \gg \hat{p}'.$ This discrepancy may be explained by the tacit assumption in analysis producing $\hat{p}'$ that the distribution of discriminants in $\mathcal{P}$ is at least approximately uniform. If the distribution of discriminants were concentrated near the squares, which are themselves concentrated in the lower positive integers, a correspondingly higher proportion of $\mathcal{P}$ would factor over $\mathbb{Z}.$
             
             In light of the uncertainty here, \texttt{PS3-1-Sorice.xlsx} was devised to determine the factorability of all $8000$ polynomials in $\mathcal{P}$. This gives $p = 892 \div 8000 = 11.15\%$, consistent with $\hat{p} = 12.9 \%$. The large discrepancy of $p$ from $ \hat{h}' \doteq 2.4 \%$ is indeed explained by the highly non-uniform distribution of discriminants, for which see Figure \ref{discdist}. This distribution has a number of interesting features, including both peakedness near zero increasing gaps between non-zero-frequency entries as the discriminant gets further from zero.
             
        \begin{figure}[H]
            \centering
            \includegraphics[width=1\linewidth]{fig1.png}
            \caption{Distribution of discriminants in $\mathcal{P}$.}
            \label{discdist}
        \end{figure}
    \end{enumerate}
    
    \item \textit{Using the \emph{GeoGebra} C.A.S., differentiate $y_n = (nx+1)^{x}$ for $n=1, 2, 3, 4$.}
  
        The results are tabulated as Table \ref{table:deriv}. See \texttt{PS3-2-1-Sorice.ggb} for details.

        \begin{table}[H]
            \centering
            \begin{tabular}{|c|c|c|}
            \hline
            $n$	& $y_n$		& Output of \texttt{Derivative}$[y_n]$		\\ [0.5ex]
            \hline
            1		& $(x+1)^x$	& $x(x+1)^{x-1} + \ln(x+1)(x+1)^x$		\\
            2		& $(2x+1)^x$	& $2x(2x+1)^{x-1} + \ln(2x+1)(2x+1)^x$	\\
            3		& $(3x+1)^x$	& $3x(3x+1)^{x-1} + \ln(3x+1)(3x+1)^x$	\\
            4		& $(4x+1)^x$	& $4x(4x+1)^{x-1} + \ln(4x+1)(4x+1)^x$	\\
            \hline
            \end{tabular}
            \caption{Derivative of $y_n$ for $n \in \{1,2,3,4\}$ computed by \emph{GeoGebra} C.A.S. \texttt{Derivative}.}
            \label{table:deriv}
        \end{table}
  
        \textit{Write the general rule for the derivative of $y_n=(nx+1)^{x}$, $n \in \mathbb{Z^{+}}$.}

        $$\frac{dy_n}{dx} = nx(nx+1)^{x-1} + \ln(nx+1)(nx+1)^x = \left[\frac{nx}{nx+1} + \ln(nx+1) \right](nx+1)^{x}.$$

        \textit{Explain how the C.A.S. output can help one in determining this rule. Be specific.}
  
        The C.A.S. facilitates discovery of this rule by allowing quick comparison of the output at various values of $n$. It's fair to say that the rule seems quite obvious from just a few instances -- the coefficient $n$ is the only thing that changes from one instance to the next and its role in the result is clear to spot.
        
        The pattern developed by the C.A.S. can also be used to verify an analytical result:
        \begin{equation*}\begin{split}
            \frac{dy_n}{dx} & = \frac{d}{dx} \left(nx+1 \right)^x = \frac{de^{x \ln(nx+1)}}{dx}  = e^{x \ln(nx+1)} \frac{d [x \ln (nx+1)]}{dx} \\
            & = (nx+1)^x \left[ \ln(nx+1) + x \frac{d \ln(nx+1)}{dx} \right] = (nx+1)^x \left[ \ln(nx+1) + x \frac{1}{nx+1} \frac{d (nx+1)}{dx} \right] \\
            & = (nx+1)^x \left[ \ln(nx+1) + x \frac{1}{nx+1} n \right] = \left[ \ln(nx+1) + \frac{nx}{nx+1} \right] (nx+1)^x,
        \end{split}\end{equation*}
        which is the same expression as above.
    
        \textit{Based only on the C.A.S. work, would it be reasonable to extend your rule to the domain $n \in \mathbb{Z}$? Explain.}
  
        It would be somewhat reasonable. The derived expression returns $0$ for $n=0$, as it ought, and the generalization that led to it applies equally well for negative $n.$ Obviously, it would be prudent to investigate the result for some negative $n,$ which can be found as \texttt{PS3-2-2-Sorice.ggb}.
        
        An important consideration is the domain of $x$ on which these results are valid. However, this is equally so for positive $n$ -- the expression is singular on $nx+1 \le 0$ in both cases. For $n>0,$ this means that the derivative is defined on $x > - \frac{1}{n}$ whereas for $n<0,$ the domain is $x < - \frac{1}{n}.$
  
  \item \textit{First, simplify (if possible) each expression below. Next, enter each of the following expressions using correct \emph{GeoGebra} syntax into the \emph{GeoGebra} C.A.S.}
  \begin{itemize}
  	\item $\sin{(\arcsin{x})}$
	
	$$\sin[\arcsin(x)] = x$$ by definition of $\arcsin$. See \texttt{PS3-3-1-Sorice.ggb} for concurring \emph{GeoGebra} result.
	
	It is interesting to note that we may have expected complications here as $\arcsin$ is only real for $-1 \le x \le 1,$ but it can be extended to a complex function almost everywhere in $\mathbb{C}$ without difficulty \cite{mwasine}. However, \emph{GeoGebra}'s C.A.S. runs into difficulties with at least some explicitly complex values, for example \texttt{arcsin}$(2),$ for which \emph{GeoGebra} C.A.S. outputs:
	$$\sin[-i\ln(i \sqrt{3} + 2 i)].$$
	This it is seemingly unable to evaluate -- c.f. \texttt{PS3-3-1-Sorice.ggb}. However, this can be evaluated analytically without much difficulty using the exponential definition of $\sin$:
	\begin{equation*}\begin{split}
            \sin[-i\ln(i \sqrt 3 + 2 i)] & = \frac{e^{i[-i\ln(i \sqrt 3 + 2 i)]}-e^{-i[-i\ln(i \sqrt 3 + 2 i)]}}{2i} = \frac{e^{\ln[i(2+\sqrt 3)]}-e^{-\ln[i(2+\sqrt 3)]}}{2i} \\
            & = \frac{i(2+\sqrt 3) - \frac{1}{i(2+\sqrt 3)}}{2i} = \frac{i(2+\sqrt 3) - \frac{1}{i(2+\sqrt 3)} \frac{i}{i}}{2i} = \frac{i(2+\sqrt 3) - \frac{i}{-(2+\sqrt 3)}}{2i} \\
            & = \frac{2+\sqrt 3 + \frac{1}{2+\sqrt 3}}{2} = \frac{2+\sqrt 3 + \frac{1}{2+\sqrt 3}\frac{2-\sqrt 3}{2-\sqrt 3}}{2} = \frac{2+\sqrt 3 + \frac{2 - \sqrt 3}{4-3}}{2} \\
            & = \frac{2 + \sqrt 3 + 2 - \sqrt 3}{2} = \frac{4}{2} = 2.
	\end{split}\end{equation*}
	
	See Figure \ref{tisas} for results from Texas Instruments' \emph{Advanced Mathematics Software} Computer Algebra System (T.I.C.A.S) running on a TI-89 calculator. This system also outputs $\sin[\arcsin(x)] = x$, but for $\sin[\arcsin(2)]$ it gives:
	$$\frac{\sqrt{4 \sqrt{3} + 7}}{2} + \frac{1}{2\sqrt{4 \sqrt{3} + 7}}.$$
	This can be reduced analytically using $7 + 4 \sqrt{3} = (2)^2 + 2 (2 \times \sqrt 3) + (\sqrt 3)^2  = (2 + \sqrt{3})^2$:
        \begin{equation*}\begin{split}
            \frac{\sqrt{4 \sqrt{3} + 7}}{2} + \frac{1}{2\sqrt{4 \sqrt{3} + 7}} & = \frac{2+\sqrt 3}{2} + \frac{1}{2(2+ \sqrt 3)} = \frac 1 2 \left( 2 + \sqrt 3 + \frac{1}{2 + \sqrt 3} \frac{2 - \sqrt 3}{2 - \sqrt 3} \right) \\
            & = \frac 1 2 \left( 2 + \sqrt 3 + \frac{2 - \sqrt 3}{4 - 3} \right) = \frac 4 2 = 2,
	\end{split}\end{equation*}
	 but T.I.C.A.S. makes this reduction itself on re-evaluation of the output -- see Figure \ref{tisas}! Clearly some simplifying function is implicitly called at output, but it is not clear why this is not done before initial output from \texttt{arcsin}. This is an odd behavior which could be considered a bug in T.I.C.A.S.
    \begin{figure}[H]
        \centering
        \subfloat{\includegraphics[width=0.495\linewidth]{ti1.png}}
        \hfill
        \subfloat{\includegraphics[width=0.495\linewidth]{ti2.png}}
        \caption{T.I.C.A.S. also outputs $x$ for $\sin[\arcsin(x)]$ and eventually reduces $\sin[\arcsin(2)]$ to $2$.}
        \label{tisas}
    \end{figure}

    These behaviors strongly suggest for both these systems that \texttt{sin}$[\text{\texttt{arcsin}}(x)] = x$ is a hard-coded output of the \texttt{sin} function, or the domain of $x$ is implicitly restricted for calls to \texttt{arcsin}$(x)$ with $x$ variable.
	
	\item $2^{-2r}4^{r}$
	
	$$2^{-2r}4^{r} = \frac{1}{2^{2r}} 4^r = \frac{4^r}{(2^2)^r} = \frac{4^r}{4^r} = 1.$$
	
	Presented this input, \emph{GeoGebra} C.A.S. outputs $4^r \cdot 2^{-2r},$ but the \texttt{Simplify} command produces the expected output, $1$. See \texttt{PS3-3-2-Sorice.ggb} for this computation. I would speculate that \emph{GeoGebra} C.A.S. makes the conservative choice to do little or no manipulation of the input beyond the most basic simplification unless explicitly told to do so by, for instance, the \texttt{Simplify} command.
	
	T.I.C.A.S. is somewhat more aggressive in this case, outputting $1$ directly on evaluation -- see Figure \ref{tirrr}.
        \begin{figure}[H]
            \centering
            \includegraphics[width=0.5\linewidth]{ti3.png}
            \caption{T.I.C.A.S. produces 1 directly from $2^{-2r}4^{r}$.}
            \label{tirrr}
        \end{figure}
		
	\item $\ln \left( t-\frac{1}{t} \right) + \ln \left( \frac{t}{t-1}\right)$
	
	$$\ln \left( t-\frac{1}{t} \right) + \ln \left( \frac{t}{t-1}\right) = \ln \left[ \left( t - \frac 1 t \right) \frac{t}{t-1} \right] = \ln \left( \frac{t^2-1}{t-1} \right) = \ln \left[ \frac{(t+1)(t-1)}{t-1} \right] = \ln(t+1).$$
	
	It should be noted that the initial expression is only defined where both the logarithms have positive input, i.e. only if both:
	$$t - \frac{1}{t} > 0 \Leftrightarrow t > \frac 1 t \Leftrightarrow [(t>0) \land (t^2 > 1)]\lor[(t<0) \land (t^2 < 1)] \equiv (t>1) \lor (-1<t<0)$$
	and:
	$$ \frac{t}{t-1} > 0 \Leftrightarrow [(t>0) \land (t-1>0)] \lor [(t<0) \land (t-1 < 0)] \equiv (t>1) \lor (t<0).$$
	Combining which yields:
	\begin{equation*}\begin{split}
            [(t>1) \lor (-1<t<0)] \land [(t>1) \lor (t<0)] \equiv & [\underbrace{(t>1) \land (t>1)}_{t>1}] \lor [\underbrace{(t>1) \land (t<0)}_{F}] \lor \\
            &[\overbrace{(-1<t<0) \land (t>1)}^{F}] \lor [(-1<t<0) \land (t<0)] \\
            \equiv & (t>1) \lor [(-1<t) \land \underbrace{(t<0) \land (t<0)}_{t<0}] \\
            \equiv & (t>1) \lor [(-1<1) \land (t<0)] \equiv (t>1) \lor (-1<t<0), \\
	\end{split}\end{equation*}
	so that the initial expression is defined on $(-1,0) \cup (1,\infty).$ On that set, $t+1 > 0,$ so the reduced expression is well-defined everywhere the initial expression was -- in fact, this was guaranteed by the method of reduction, which assumed only that both inputs were positive (at the combination of logarithms.) However, the reduced function is also valid on $[0,1],$ which the initial function is not! Therefore, it will be best to explicitly state:
	$$ \ln \left( t-\frac{1}{t} \right) + \ln \left( \frac{t}{t-1}\right) = \begin{cases} \ln(t+1), & (-1<t<0) \lor (t > 1) \\ \text{undefined,} & \text{elsewhere} \end{cases}.$$
	
	As with the previous part, \emph{GeoGebra} C.A.S. outputs the input, but \texttt{Simplify} provides the reduced answer $\ln(t+1)$. The invalidity of the reduction for $0 \le t \le 1$ is not mentioned, which must be counted as a loss of fidelity. See \texttt{PS3-3-3-Sorice.ggb} for details.
	
	T.I.C.A.S. does not reduce the expression unless a correct condition is placed on $t$:
	
        \begin{figure}[H]
            \centering
            \includegraphics[width=0.5\linewidth]{ti4.png}
            \caption{No reduction from T.I.C.A.S. unless restriction placed on $t$.}
            \label{tinored}
        \end{figure}

	but when correct stipulations are placed using the \texttt{|} operator, full and correct reduction is done at evaluation: 
	
    \begin{figure}[H]
        \centering
        \includegraphics[width=0.5\linewidth]{ti6.png}
        \caption{Reduction at evaluation by T.I.C.A.S. when $t$ properly restricted.}
        \label{tifullred}
    \end{figure}

	Further, T.I.C.A.S. produces valid partial simplification if lesser restrictions are placed:
	
        \begin{figure}[H]
            \centering
            \includegraphics[width=0.5\linewidth]{ti7.png}
            \caption{Partial reduction from T.I.C.A.S. when proper restriction placed on $t$.}
            \label{tipartred}
        \end{figure}
	
  \end{itemize}

\end{enumerate}

\newpage \printbibliography

 \end{document}
