From 23394c78af4166365a5ad578ac823fb97f680c02 Mon Sep 17 00:00:00 2001 From: NotXia <35894453+NotXia@users.noreply.github.com> Date: Tue, 20 Feb 2024 20:51:42 +0100 Subject: [PATCH] Add LAAI3 introduction --- .../module3/ainotes.cls | 1 + .../module3/laai3.tex | 13 +++ .../module3/sections/_intro.tex | 88 +++++++++++++++++++ 3 files changed, 102 insertions(+) create mode 120000 src/languages-and-algorithms-for-ai/module3/ainotes.cls create mode 100644 src/languages-and-algorithms-for-ai/module3/laai3.tex create mode 100644 src/languages-and-algorithms-for-ai/module3/sections/_intro.tex diff --git a/src/languages-and-algorithms-for-ai/module3/ainotes.cls b/src/languages-and-algorithms-for-ai/module3/ainotes.cls new file mode 120000 index 0000000..146fd3c --- /dev/null +++ b/src/languages-and-algorithms-for-ai/module3/ainotes.cls @@ -0,0 +1 @@ +../../ainotes.cls \ No newline at end of file diff --git a/src/languages-and-algorithms-for-ai/module3/laai3.tex b/src/languages-and-algorithms-for-ai/module3/laai3.tex new file mode 100644 index 0000000..eada60f --- /dev/null +++ b/src/languages-and-algorithms-for-ai/module3/laai3.tex @@ -0,0 +1,13 @@ +\documentclass[11pt]{ainotes} + +\title{Languages and Algorithms for\\Artificial Intelligence\\(Module 3)} +\date{2023 -- 2024} +\def\lastupdate{{PLACEHOLDER-LAST-UPDATE}} +\newcommand{\enc}[1]{{\llcorner{#1}\lrcorner}} + +\begin{document} + + \makenotesfront + \input{sections/_intro.tex} + +\end{document} \ No newline at end of file diff --git a/src/languages-and-algorithms-for-ai/module3/sections/_intro.tex b/src/languages-and-algorithms-for-ai/module3/sections/_intro.tex new file mode 100644 index 0000000..bbb4cc8 --- /dev/null +++ b/src/languages-and-algorithms-for-ai/module3/sections/_intro.tex @@ -0,0 +1,88 @@ +\chapter{Introduction} + +\begin{description} + \item[Computational task] \marginnote{Computational task} + Description of a problem. + + \item[Computational process] \marginnote{Computational process} + Algorithm to solve a task. + + \begin{description} + \item[Algorithm (informal)] + A finite description of + elementary and deterministic computation steps. + \end{description} +\end{description} + + +\section{Notations} + +\begin{description} + \item[Set of the first $n$ natural numbers] + Given $n \in \mathbb{N}$, we have that $[n] = \{ 1, \dots, n \}$. +\end{description} + + +\subsection{Strings} + +\begin{description} + \item[Alphabet] \marginnote{Alphabet} + Finite set of symbols. + + \item[String] \marginnote{String} + Finite, ordered, and possibly empty tuple of elements of an alphabet. + + The empty string is denoted as $\varepsilon$. + + \item[Strings of given length] + Given an alphabet $S$ and $n \in \mathbb{N}$, we denote with $S^n$ the set of all the strings over $S$ of length $n$. + + \item[Kleene star] \marginnote{Kleene star} + Given an alphabet $S$, we denote with $S^* = \bigcup_{n=0}^{\infty} S^n$ the set of all the strings over $S$. + + \item[Language] \marginnote{Language} + Given an alphabet $S$, a language $\mathcal{L}$ is a subset of $S^*$. +\end{description} + + +\subsection{Tasks encoding} + +\begin{description} + \item[Encoding] \marginnote{Encoding} + Given a set $A$, any element $x \in A$ can be encoded into a string of the language $\{0, 1\}^*$. + The encoding of $x$ is denoted as $\enc{x}$ or simply $x$. + + \item[Task function] \marginnote{Task} + Given two countable sets $A$ and $B$ representing the domain, + a task can be represented as a function $f: A \rightarrow B$. + + When not stated, $A$ and $B$ are implicitly encoded into $\{0, 1\}^*$. + + \item[Characteristic function] \marginnote{Characteristic function} + Boolean function of form $f: \{0, 1\}^* \rightarrow \{0, 1\}$. + + Given a characteristic function $f$, the language $\mathcal{L}_f = \{ x \in \{0, 1\}^* \mid f(x) = 1 \}$ + can be defined. + + \item[Decision problem] \marginnote{Decision problem} + Given a language $\mathcal{M}$, a decision problem is the task of computing a boolean function $f$ + able to determine if a string belongs to $\mathcal{M}$ (i.e. $\mathcal{L}_f = \mathcal{M}$). +\end{description} + + +\subsection{Asymptotic notation} + +\begin{description} + \item[Big O] \marginnote{Big O} + A function $f: \mathbb{N} \rightarrow \mathbb{N}$ is $O(g)$ if $g$ is an upper bound of $f$. + \[ f \in O(g) \iff \exists \bar{n} \in \mathbb{N} \text{ such that } \forall n > \bar{n}, \exists c \in \mathbb{R}: f(n) \leq c \cdot g(n) \] + + \item[Big Omega] \marginnote{Big Omega} + A function $f: \mathbb{N} \rightarrow \mathbb{N}$ is $\Omega(g)$ if $g$ is a lower bound of $f$. + \[ f \in \Omega(g) \iff \exists \bar{n} \in \mathbb{N} \text{ such that } \forall n > \bar{n}, \exists c \in \mathbb{R}: f(n) \geq c \cdot g(n) \] + + \item[Big Theta]\marginnote{Big Theta} + A function $f: \mathbb{N} \rightarrow \mathbb{N}$ is $\Theta(g)$ if $g$ is both an upper and lower bound of $f$. + \[ f \in \Theta(g) \iff f \in O(g) \text{ and } f \in \Omega(g) \] + +\end{description} \ No newline at end of file