\documentclass{article}[12pt]

% useful packages
\usepackage{titlesec}
\usepackage{fullpage}
\usepackage{amsmath,amssymb,amsthm,amsfonts}
\usepackage{graphicx}
\usepackage{enumerate}
\usepackage{algorithm,algorithmic}
\usepackage{xcolor}
\usepackage{bbm}
\usepackage{url}
\usepackage{hyperref}

% theorem type environments
\newtheorem{thm}{Theorem}
\newtheorem{prop}{Proposition}
\newtheorem{lemma}{Lemma}
\newtheorem{cor}{Corollary}
\newtheorem{defn}{Definition}
\newtheorem{assump}{Assumption}
\newtheorem{example}{Example}
\newtheorem{conjecture}{Conjecture}

% frequently used symbols
\newcommand{\bE}{\mathbb{E}}
\newcommand{\bP}{\mathbb{P}}
\newcommand{\bQ}{\mathbb{Q}}
\newcommand{\bR}{\mathbb{R}}
\newcommand{\bS}{\mathbb{S}}
\newcommand{\bN}{\mathbb{N}}
\newcommand{\bZ}{\mathbb{Z}}
\newcommand{\sC}{{\mathcal C}} 
\newcommand{\sD}{{\mathcal D}} 
\newcommand{\sE}{{\mathcal E}} 
\newcommand{\sF}{{\mathcal F}} 
\newcommand{\sL}{{\mathcal L}} 
\newcommand{\sH}{{\mathcal H}} 
\newcommand{\sN}{{\mathcal N}} 
\newcommand{\sO}{{\mathcal O}} 
\newcommand{\sP}{{\mathcal P}} 
\newcommand{\sR}{{\mathcal R}} 
\newcommand{\sS}{{\mathcal S}}
\newcommand{\sU}{{\mathcal U}} 
\newcommand{\sX}{{\mathcal X}} 
\newcommand{\sY}{{\mathcal Y}} 
\newcommand{\sZ}{{\mathcal Z}}

% operators
\newcommand{\sign}{\mathop{\mathrm{sign}}}
\newcommand{\supp}{\mathop{\mathrm{supp}}} % support
\newcommand{\argmin}{\operatornamewithlimits{arg\ min}}
\newcommand{\argmax}{\operatornamewithlimits{arg\ max}}
\newcommand{\dist}{\operatorname{dist}}
\newcommand{\tr}{\text{tr}}
\newcommand{\vecop}{\text{vec}}
\newcommand{\st}{\operatorname{s.t.}}
\newcommand{\cut}{\setminus}
\newcommand{\ind}[1]{\mathbbm{1}\left\{#1\right\}} 
\newcommand{\given}{\ | \ }

% grouping operators
\newcommand{\brac}[1]{\left[#1\right]}
\newcommand{\set}[1]{\left\{#1\right\}}
\newcommand{\abs}[1]{\left\lvert #1 \right\rvert}
\newcommand{\paren}[1]{\left(#1\right)}
\newcommand{\norm}[1]{\left\|#1\right\|}
\newcommand{\ip}[2]{\left\langle #1,#2 \right\rangle}

% code commands
\newcommand{\matlab}{\textsc{Matlab }}
\newcommand{\python}{\textsc{Python }}

% header command
\newcommand{\homework}[3]{
    \pagestyle{myheadings}
    \thispagestyle{plain}
    \newpage
    \setcounter{page}{1}
    \setlength{\headsep}{10mm}
    \noindent
    \begin{center}
    \framebox{
        \vbox{\vspace{2mm}
            \hbox to 6.28in { {\bf EE 518: Machine Learning Theory \& Algorithms
            \hfill Spring \the\year} }
        \vspace{4mm}
        \hbox to 6.28in { {\Large \hfill Homework #1 \hfill} }
        \vspace{2mm}
        \hbox to 6.28in { \Large \hfill Due: #2, 11:59PM PT \hfill }
        \vspace{2mm}
        \hbox to 6.28in { {\it Student Name: #3} \hfill {\it Instructor Name: John Lipor}}
        \vspace{2mm}}
   }
   \end{center}
   \markboth{Homework #1}{Homework #1}
   \vspace*{4mm}
}

% For problem titles
\titleformat{\section}{\normalfont\bf}{Problem \thesection}{1em}{}

\begin{document}

% PUT YOUR NAME BELOW WHERE I HAVE \X
\homework{0}{April 5, \the\year}{}
% PUT YOUR NAME ABOVE WHERE I HAVE \X

\section{\normalfont{(0 pts)}}

Create a gradescope account on \url{https://gradescope.com}. 
Use course entry code \textbf{3P8WE6} and use your PDX email and PDX Student ID and your given name and family name.
Turning this assignment in via gradescope will be confirmation that you have completed this problem.

Be sure to follow the instructions given \href{http://gradescope-static-assets.s3-us-west-2.amazonaws.com/help/submitting_hw_guide.pdf}{here} and link all problems to get credit.

\section{\normalfont{(0 pts)}}

Join the course Discord server following the link \href{https://discord.gg/kwq5CVQR}{here}.

\section{\normalfont{(1 pt)}}

\textbf{Data Science Skillz:} The main goal of this course is for you to gain a thorough understanding of how machine learning algorithms work and why. However, to work as a data scientist, a number of other skills are required, two of which are (a) dealing with messy datasets that are not in the format required for you to apply machine learning, and (b) communicating your results. Throughout the quarter, I will assign a number of \emph{data science skillz} (DSS) problems designed to
help you develop yourself in this area. These will typically focus on real-world or competition datasets (e.g., \href{http://kaggle.com}{Kaggle}). However, I will not lecture on these topics, so it is up to you to learn these skills on your own, just as you would in a job as a data scientist. As a result, \textbf{for DSS problems only}, the following rules apply:
\begin{itemize}
    \item You may make full use of StackExchange, LLMs, or any other online resource you can find.
    \item You may copy code from the internet or a language model (e.g., ChatGPT), but you must \textbf{understand} what the code is doing and \textbf{cite} the source you copied it from.
    \item You may \textbf{not} copy code from other students in this class.
\end{itemize}
Other rules may be added throughout the quarter, and DSS rules apply only when clearly indicated on a homework problem.
Turn in a statement that you have read and will comply with DSS rules for these problems.

\section{\normalfont{(1 pt)}}

\textbf{Statistical Learning Theory:} The primary framework through which we analyze machine learning algorithms is known as \emph{statistical learning theory} (SLT), and we will devote a major portion of this course to this topic. However, these problems are generally more difficult than is appropriate for this course. Moreover, the solutions to the problems in the textbook are provided on the authors' website. As a result, your task on SLT problems will be to spend \textbf{at
least fifteen uninterrupted minutes} attempting to solve the problem, after which you are free to use the solutions manual to help you work through the problem. During these fifteen minutes, you should not check email, slack, or any other form of digital media, but instead focus your entire attention to solving the problem. In your homework, you must clearly explain what is happening in each nontrivial step,\footnote{The term ``nontrivial'' is subjective, but you should air on the side of providing more
information than you think is necessary.} and you should \emph{not} simply repeat what is written in the solution. The goal of these problems is to help you digest the reading and enable you to be more confident in understanding the
theoretical results of machine learning research. As with DSS problems, SLT problems will be clearly indicated. Turn in a statement that you have read and will comply with SLT rules for these problems.

\section{\normalfont{(1 pt)}}

Suppose that three independent random variables $X, Y,$ and $Z$ are distributed according to
\begin{equation*}
    X \sim \sN(1,1) \quad Y \sim \sN(1,2) \quad Z \sim \sN(2,4),
\end{equation*}
where $\sN(\mu,\sigma^{2})$ denotes the Gaussian/normal distribution with mean $\mu$ and variance $\sigma^{2}$. What is the probability that $(X-Y)Z < 0$?

\section{\normalfont{(1 pt)}}

Suppose that the event $A$ occurs with probability 0.75 and the probability that \textbf{both} $A$ and $B$ occur is 0.3. If $A$ and $B$ are independent events, what is the probability that \textbf{neither} $A$ nor $B$ occur?

\section{\normalfont{(1 pt)}}

Let $X \sim \sN(\mu,\sigma^{2})$. Let $a, b \in \bR$ and $Y = aX + b$. Find $a, b$ such that $Y \sim \sN(0,1)$.

\section{\normalfont{(1 pt each)}}

\begin{enumerate}[(a)]
    \item Let $x, y \in \bR^{n}$. Under what conditions on $x$ and $y$ is it true that
        \begin{equation*}
            \norm{x+y}_{2}^{2} = \norm{x}_{2}^{2} + \norm{y}_{2}^{2}?
        \end{equation*}
    \item Under what conditions on $x$ and $y$ is it true that
        \begin{equation*}
            \norm{x+y}_{2} = \norm{x}_{2} + \norm{y}_{2}?
        \end{equation*}
\end{enumerate}

\section{\normalfont{(1 pt)}}

Let
\begin{equation*}
    A = \begin{bmatrix}
        -2 & 2 & 2 & -2 & 0 \\
        -2 & 2 & 2 & -2 & 0 \\
        2 & -2 & -2 & 2 & 0 \\
        0 & 0 & 0 & 0 & 2 \\
        0 & 0 & 0 & 0 & 2
    \end{bmatrix}.
\end{equation*}
What is $\text{rank}(A)$ and how did you come to this answer?

\section{\normalfont{(1 pt)}}

Show that if $A, B \in \bR^{n \times n}$ have the same eigenvectors, then $AB = BA$.

\end{document}
