\documentclass{article} \usepackage{xspace} \usepackage{fancyhdr} \usepackage{graphicx} \usepackage{amsmath,amssymb,amsthm} \usepackage{microtype} \usepackage{enumitem} \usepackage{ifthen} \usepackage{totcount} \usepackage[usenames]{xcolor} \usepackage[most]{tcolorbox} \usepackage[a4paper, margin=1in]{geometry} \graphicspath{ {./figures/} } %-------------------------------------------------------------------------------- \newcommand{\edition}{2024-2025} \newcommand{\deadline}{22 November 2024, 09:00} \newcommand{\hwNum}{1} %-------------------------------------------------------------------------------- % Style stuff \pagestyle{fancy} \lhead{Geometric Algorithms (INFOGA \edition)} \chead{} \rhead{\mytitle} \lfoot{INFOGA \edition} \cfoot{} \rfoot{\thepage} \renewcommand{\headrulewidth}{0.4pt} \renewcommand{\footrulewidth}{0.4pt} \renewcommand{\familydefault}{\sfdefault} %-------------------------------------------------------------------------------- % Question macro's \newcommand{\withpoints}[1]{% \addtocounter{pointscounter}{#1} \printpoints{#1} } \newcommand{\printpoints}[1]{% \ifthenelse{#1 = 0} {} {\textit{(#1 points)}}\mbox{} } \newenvironment{question}[1][0]{\begin{tcolorbox}[parbox=false ,breakable=true ,enhanced jigsaw ,title=\bfseries Question \stepcounter{questionscounter}\arabic{questionscounter} \withpoints{#1}] } {\end{tcolorbox}} \newenvironment{subquestions}{\begin{enumerate}[leftmargin=* ]} {\end{enumerate}} \newcommand{\subquestion}[1][0]{\item \withpoints{#1}} \newtotcounter{questionscounter} \newtotcounter{pointscounter} \newcommand{\numquestions}{\total{questionscounter}} \newcommand{\numpoints}{\total{pointscounter}} %-------------------------------------------------------------------------------- \newcommand{\myremark}[3]{\textcolor{blue}{\textsc{#1 #2:}} \textcolor{red}{\textsf{#3}}} % \renewcommand{\myremark}[3]{} \newcommand{\frank}[2][says]{\myremark{Frank}{#1}{#2}} %-------------------------------------------------------------------------------- % Theorem Environments \newtheorem{theorem} {Theorem} \newtheorem{lemma}[theorem] {Lemma} \newtheorem{corollary}[theorem] {Corollary} \newtheorem{problem}[theorem] {Problem} \newtheorem{observation}[theorem] {Observation} \newtheorem{claim}[theorem] {Claim} \newtheorem{invariant}[theorem] {Invariant} %-------------------------------------------------------------------------------- % Otherwise useful Macro's \newcommand{\eps}{\ensuremath{\varepsilon}\xspace} \DeclareMathOperator{\argmin}{argmin} \newcommand{\mkmbb}[1]{\ensuremath{\mathbb{#1}}\xspace} \newcommand{\R}{\mkmbb{R}} \newcommand{\mkmcal}[1]{\ensuremath{\mathcal{#1}}\xspace} \newcommand{\RR}{\mkmcal{R}} %-------------------------------------------------------------------------------- % The Actual document \newcommand{\mytitle}{Homework Exam \hwNum\xspace\edition} \title{\mytitle} \date{\textbf{Deadline: } \deadline} \author{{\color{red} My name and StudentID go here!}} \begin{document} \maketitle \thispagestyle{fancy} \noindent This homework exam has \numquestions\xspace question for a total of \numpoints\xspace points. You can earn an additional point by a careful preparation of your hand-in: using a good layout, good spelling, good figures, no sloppy notation, no statements like ``The algorithm runs in $n\log n$.'' (forgetting the $O(..)$ and forgetting to say that it concerns time), etc. Use lemmas, theorems, and figures where appropriate. \begin{question} Let $P$ be a set of $n$ points in $\R^2$, and let \RR be a set of $m$, possibly pairwise intersecting, polygonal regions. You can assume by general position that all points and vertices have unique coordinates, and that no three points and vertices are colinear. The depth $d_\RR(p)$ of a point $p$ with respect to \RR is the number of regions from \RR that contain it. \begin{subquestions} \subquestion[6] Consider the scenario in which all regions in \RR are axis-aligned rectangles. Design an $O((n+m)\log (n+m))$ time algorithm that computes, for each point in $P$, its depth with respect to \RR. Prove that your algorithm is correct and achieves the desired running time. \subquestion[2] An equilateral triangle is axis aligned when one of its sides is axis aligned. Extend your algorithm from question (a) to the case where all regions in \RR are axis aligned equilateral triangles. Briefly argue that your algorithm is correct and analyze its running time. (Note that you do not have to repeat the entire description from question (a). Focus on what is different.) \subquestion[1] Can your algorithm (from question (a) and/or (b)) still compute the depths in $O((n+m)\log (n+m))$ time in case the regions in \RR are arbitrary triangles? Briefly argue why/why not. \end{subquestions} \end{question} \end{document}