\documentclass{article}

% For fancy drawing
\usepackage{tikz, subfigure}

\usepackage[papersize={140mm, 100mm}, text={130mm, 90mm}]{geometry}

% order: \order[st]{1}, \order{k}
\newcommand{\order}[2][th]{\ensuremath{{#2}^{\mathrm{#1}}}}

\begin{document}
\pagestyle{empty}
\begin {figure}[h]
  \centering
  \subfigure[staying inside the folding]{
    \begin{tikzpicture}
      [
      line/.style = {draw, thick},
      arrow/.style = {draw, semithick, -latex},
      dot/.style = {draw, fill=black},
      ]
      
      \coordinate (O) at (3cm, 0cm);
      \coordinate (J) at (1cm, 0cm);
      \coordinate (L) at (2cm, 0cm);
      \coordinate (K) at (4cm, 0cm);
      
      \coordinate (A) at (0cm, 0cm);
      \coordinate (B) at (5cm, 0cm);
      \node at (A) {};
      \node at (B) {};

      \path [arrow] ([yshift=2mm]L) -- node [above] {$\ell_{i+1}$} ([yshift=2mm]O);
      \path [line] (J) -- (K);
      
      \fill [dot] (J) circle (.3mm);
      \fill [dot] (L) circle (.3mm);
      \fill [dot] (K) circle (.3mm);
      
      \node [below] at (L) {$k'$};
      \node [below] at (K) {$j$};
      \node [below] at (J) {$0$};
      \node [below] at (O) {$k$};
   \end{tikzpicture}
  }
  \qquad\qquad
  \subfigure[stretching beyond the folding]{
    \begin{tikzpicture}
      [
      line/.style = {draw, thick},
      arrow/.style = {draw, semithick, -latex},
      dot/.style = {draw, fill=black},
      ]
      
      \coordinate (O) at (3cm, 0cm);
      \coordinate (J) at (0cm, 0cm);
      \coordinate (L) at (1cm, 0cm);
      \coordinate (K) at (2cm, 0cm);
      
      \coordinate (A) at (-1cm, 0cm);
      \coordinate (B) at (4cm, 0cm);
      \node at (A) {};
      \node at (B) {};

      \path [arrow] ([yshift=2mm]L) -- node [above] {$\ell_{i+1}$} ([yshift=2mm]O);
      \path [line] (J) -- (K);
      
      \fill [dot] (J) circle (.3mm);
      \fill [dot] (L) circle (.3mm);
      \fill [dot] (K) circle (.3mm);
      
      \node [below] at (L) {$k'$};
      \node [below] at (K) {$j'$};
      \node [below] at (O) {$j$};      
      \node [below] at (J) {0};
    \end{tikzpicture}
  }
 \caption{The $\order{(i+1)}$ segment folded to the right}
\end{figure}

\begin {figure}[h]
  \centering
  \subfigure[staying inside the folding]{
    \begin{tikzpicture}
      [
      line/.style = {draw, thick},
      arrow/.style = {draw, semithick, -latex},
      dot/.style = {draw, fill=gray!50},
      ]
      
      \coordinate (O) at (2cm, 0cm);
      \coordinate (J) at (1cm, 0cm);
      \coordinate (L) at (3cm, 0cm);
      \coordinate (K) at (4cm, 0cm);
      
      \coordinate (A) at (0cm, 0cm);
      \coordinate (B) at (5cm, 0cm);
      \node at (A) {};
      \node at (B) {};

      \path [arrow] ([yshift=2mm]L) -- node [above] {$\ell_{i+1}$} ([yshift=2mm]O);
      \path [line] (J) -- (K);
      
      \fill [dot] (J) circle (.3mm);
      \fill [dot] (L) circle (.3mm);
      \fill [dot] (K) circle (.3mm);
      
      \node [below] at (L) {$k'$};
      \node [below] at (K) {$j$};
      \node [below] at (J) {$0$};
      \node [below] at (O) {$k$};
    \end{tikzpicture}
  }
  \qquad\qquad
  \subfigure[stretching beyond the folding]{
    \begin{tikzpicture}
      [
      border/.style = {draw=gray!90, thick},
      line/.style = {draw, thick},
      arrow/.style = {draw, semithick, -latex},
      dot/.style = {draw, fill=gray!50},
      ]
      
      \coordinate (O) at (0cm, 0cm);
      \coordinate (J) at (1cm, 0cm);
      \coordinate (L) at (2cm, 0cm);
      \coordinate (K) at (3cm, 0cm);
      
      \path [arrow] ([yshift=2mm]L) -- node [above] {$\ell_{i+1}$} ([yshift=2mm]O);
      \path [line] (J) -- (K);
      
      \fill [dot] (J) circle (.3mm);
      \fill [dot] (L) circle (.3mm);
      \fill [dot] (K) circle (.3mm);
      
      \node [below] at (J) {$0$};
      \node [below] at (L) {$k'$};
      \node [below] at (K) {$j'$};
      \node [below] at (O) {$k'-\ell_{i+1}$};
      
      \path [border] (O) -- ([yshift=3mm]O);
    \end{tikzpicture}
  }
  \caption{The $\order{(i+1)}$ segment folded to the left}
\end{figure}
\end{document}
Comments Off on carpenter’s ruler

\documentclass{article}

\usepackage[papersize={85mm, 20mm}, text={75mm, 15mm}]{geometry}

\usepackage{pgf, tikz}
\usetikzlibrary{arrows,automata}

\begin{document}
\begin{figure}[h]
  \footnotesize
  \centering
  \begin{tikzpicture}[
    % type of arrow head
    >=stealth',
    % keep arrow head from touching the surface
    shorten >= 1pt,
    % automatic node positioning
    auto,
    % 
    node distance=1.5cm,
    % line thickness
    semithick,
    % text for the initial state arrow. I left it as blank
    initial text=]
    \tikzstyle{every state}=[draw=blue!50, thick, fill=blue!20,
    minimum size=4mm]
    
    \node[state] (v1) {$v_1$};
    \node[state] (v2) [right of=v1] {$v_2$};
    \node[state] (v3) [right of=v2] {$v_3$};
    \node[state] (v4) [right of=v3] {$v_4$};
    \node[state] (v5) [right of=v4] {$v_5$};
    
    \path[->] (v1) edge (v2);
    \path[->] (v3) edge (v4);
    \path[->] (v4) edge (v5);

    \path[->, bend right, bend angle = 5] (v2) edge (v5);
    \path[->, bend left, bend angle = 25] (v1) edge (v3);
  \end{tikzpicture}
\end{figure}
\end{document}
Comments Off on directed graph

pdf

\documentclass[12pt]{article}

\usepackage[papersize={6in, 9.1in}, text={5.5in, 8.8in}]{geometry}
\usepackage{amsmath}

\usepackage{mathspec}
\usepackage{fontspec}
\defaultfontfeatures{Scale=MatchLowercase}
\setmainfont[Mapping=tex-text]{Minion Pro}
%\setmainfont[Mapping=tex-text]{Hoefler Text}
%\setmainfont[Mapping=tex-text]{Garamond}
\setsansfont[Mapping=tex-text]{Candara}
%\setsansfont[Mapping=tex-text]{Myriad Pro}
%\setsansfont[Mapping=tex-text]{Comic Sans MS}
%\setmonofont{Courier}
\setmonofont{Monaco}

\usepackage{paralist}

\newcommand{\fpd}[2]{\ensuremath{\frac{\partial{#1}}{\partial{#2}}}}

\begin{document}
\thispagestyle{empty}
The Cauchy distribution is a symmetric distribution on
$(-\infty,\infty)$ with pdf
\begin{equation*}
  f_X(x;\theta,\gamma) =
  \frac1\pi \cdot \frac{\gamma}{(x-\theta)^2+\gamma^2}
\end{equation*}
In this paper, we only deal with the case $\theta=0$.

Consider two independent Gaussian random variables $X,Y\sim N(0,1)$.
We will prove that the ratio $X/Y$ is a Cauchy distribution by
\begin{inparaenum}[(1)]
\item defining the transformation $U=X/Y$ and $V=|Y|$,
\item finding the joint pdf $F_{U,V}(u,v)$, and
\item integrating out $V$ to obtain the marginal pdf of $U$.
\end{inparaenum}

Unfortunately, the mapping $U=X/Y$ and $V=|Y|$ is not one-to-one:
the two points $(x,y)$ and $(-x,-y)$ map to the same $(u,v)$
We need to partition $(X,Y)$ into $A_0,A_1,A_2$ such that the mapping
from $A_i$ to $(U,V)$ is one-to-one.
\begin{enumerate}
  \item $A_0=\{(X,Y):Y=0\}$: This exceptional case does not happen
    because $\Pr[Y=0]=0$ when $Y\sim N(0,1)$.
  \item $A_1=\{(X,Y):Y>0\}$: The mapping $U=X/Y$, $V=|Y|$ is
    one-to-one, and the inverse mappings are $h_{11}(u,v)=uv$,
    $h_{21}=v$.
  \item $A_2=\{(X,Y):Y<0\}$: The mapping $U=X/Y$, $V=|Y|$ is
    one-to-one, and the inverse mappings are $h_{12}(u,v)=-uv$,
    $h_{22}=-v$.
\end{enumerate}
\begin{equation*}
\begin{array}{lllll}
  J_1 & =
  \begin{vmatrix}
    \fpd{h_{11}}{u} & \fpd{h_{11}}{v} \\
    \fpd{h_{21}}{u} & \fpd{h_{21}}{v}
  \end{vmatrix}
  & = 
  \begin{vmatrix}
    \fpd{uv}{u} & \fpd{uv}{v} \\
    \fpd{v}{u} & \fpd{v}{v}
  \end{vmatrix}
  &=
  \begin{vmatrix}
    v & u \\ 0 & 1
  \end{vmatrix}
  &= v \\
  J_2 &= 
  \begin{vmatrix}
    \fpd{h_{12}}{u} & \fpd{h_{12}}{v} \\
    \fpd{h_{22}}{u} & \fpd{h_{22}}{v}
  \end{vmatrix}
  &= 
  \begin{vmatrix}
    \fpd{(-uv)}{u} & \fpd{(-uv)}{v} \\
    \fpd{(-v)}{u} & \fpd{(-v)}{v}
  \end{vmatrix}
  &=
  \begin{vmatrix}
    -v & -u \\ 0 & -1
  \end{vmatrix}
  &= v
\end{array}
\end{equation*}
%%%
\begin{equation*}
  f_{X,Y}(x,y) =
  \frac{1}{\sqrt{2\pi}}\exp(-x^2/2)
  \frac{1}{\sqrt{2\pi}}\exp(-y^2/2) =
  \frac{1}{2\pi}\exp\left(-\frac{x^2+y^2}{2}\right)
\end{equation*}
%%%
\begin{align*}
  f_{UV}(u,v) &= f_{XY}(h_{11}(u,v),h_{21}(u,v))|J_1|
  + f_{XY}(h_{12}(u,v),h_{22}(u,v))|J_2| \\
  &= \frac{1}{2\pi}\exp\left(-\frac{(uv)^2 + v^2}{2}\right)|v| +
  \frac{1}{2\pi}\exp\left(-\frac{(-uv)^2 + (-v)^2}{2}\right)|v| \\
  &= \frac{v}{\pi}\exp\left(-\frac{v^2(u^2+1)}{2}\right),
  \qquad -\infty < u < \infty, \quad0<v<\infty \\
\end{align*}
%%%
\begin{alignat*}{2}
  f_U(u) &=
  \int_0^\infty \frac{v}{\pi}\exp\left(-\frac{v^2(u^2+1)}{2}\right) dv
  & \text{integrating out $V$}\\
  &= \int_0^\infty \frac{1}{2\pi}\exp\left(-\frac{u^2+1}{2}z\right) dz
  & \qquad\text{Let $z=v^2$ and $dz=2vdv$} \\
  &= \frac{1}{2\pi}\cdot \frac{2}{u^2+1}
  & \int_0^\infty \exp(-\alpha z) dz = \frac1\alpha \\
  &= \frac{1}{\pi}\cdot\frac{1}{u^2+1},\qquad -\infty< u<\infty
\end{alignat*}
\end{document}


cauchy

\documentclass[10pt]{article}
\pagestyle{empty}
\usepackage{amsmath,amssymb,amsthm}
\usepackage[papersize={140mm, 210mm}, text={120mm, 200mm}]{geometry}

% For fancy fonts
\usepackage[T1]{fontenc}
\usepackage{ccfonts,eulervm}

\usepackage{tikz}

\newcommand{\fpd}[2]{\ensuremath{\frac{\partial{#1}}{\partial{#2}}}}

\thispagestyle{empty}

\begin{document}
The ratio of two Gaussian random variables $X,Y\sim N(0,1)$ is a
Cauchy distribution.
Let $U=X/Y$ and $V=|Y|$. If $Y=0$, $U$ and $V$ can be any value
because $\Pr(Y=0)=0$.
If we restrict consideration to either positive or negative value of
$Y$, then the transform from $\mathcal{A}=(X,Y)$ to
$\mathcal{B}=(U,V)$ is one-to-one.
\begin{equation*}
  A_1 = \{(x,y): y > 0 \},\qquad
  A_2 = \{(x,y): y < 0 \},\qquad
  A_3 = \{(x,y): y = 0 \}
\end{equation*}
These three partition $\mathcal{A}=\mathbb{R}^2$ and
$\Pr[(X,Y)\in A_0]=\Pr[Y=0]=0$.
\begin{figure}[h]
  \centering
  \begin{tikzpicture}
    [line/.style ={draw, thick, -latex, shorten >=2pt},]
    \def\myradius{1.5cm}
    % left circle
    \shadedraw[left color=blue!10, right color=blue!60,
    draw=blue!50!black]
    (0, 0) -- (\myradius, 0mm) arc (0:150:\myradius) -- cycle; 
    \shadedraw[left color=red!10, right color=red!60,
    draw=red!50!black]
    (0, 0) -- (\myradius, 0mm) arc (0:-150:\myradius) -- cycle;
    \draw (0,0) circle (\myradius);

    \node at (5mm, 8mm) {$A_1$};
    \node at (5mm, -8mm) {$A_2$};
    \node at (-9mm, 0mm) {$A_0$};

    \node at (0cm, \myradius+5mm) {$\mathcal{A}=\mathbb{R}^2=(X,Y)$};

    % right circle
    \shade[left color=black!10, right color=black!40,
    draw=black!50!black] (6cm, 0) circle (\myradius);
    \node at (\myradius*4, \myradius+5mm)
    {$\mathcal{B}=\{(U,V):V\geq 0\}$};

    % arrows
    \path (\myradius*4-3mm, 8mm) edge [line, bend angle=10, bend right]
    node [above, midway] {$h_{11},h_{21}$} (8mm, 8mm);
    \path (8mm, 6mm) edge [line, bend angle=10, bend right]
    (\myradius*4-3mm, 6mm);
    
    \path (\myradius*4-3mm, -8mm) edge [line, bend angle=10, bend left]
    node [below, midway] {$h_{12},h_{22}$} (8mm, -8mm);
    \path (8mm, -6mm) edge [line, bend angle=10, bend left]
    (\myradius*4-3mm, -6mm);

  \end{tikzpicture}
\end{figure}

\begin{alignat*}{3}
  \mathcal{B} \to \mathcal{A}_1:&
  x=h_{11}(u,v)=uv, &\quad&y=h_{21}(u,v)=v \\
  \mathcal{B} \to \mathcal{A}_2:&
  x=h_{12}(u,v)=-uv, &\quad&y=h_{22}(u,v)=-v
\end{alignat*}

\begin{equation*}
  J_1 =
  \left|
  \begin{array}{cc}
    \fpd{uv}{u} & \fpd{uv}{v} \\
    \fpd{v}{u} & \fpd{v}{v}
  \end{array}
  \right|
  =
  \begin{vmatrix}
    v & u \\ 0 & 1 \\
  \end{vmatrix}
  = v,\quad
  J_2 =
  \left|
  \begin{array}{cc}
    \fpd{(-uv)}{u} & \fpd{(-uv)}{v} \\
    \fpd{(-v)}{u} & \fpd{(-v)}{v}
  \end{array}
  \right|
  =
  \begin{vmatrix}
    -v & -u \\ 0 & -1 \\
  \end{vmatrix}
  = v
\end{equation*}

\begin{equation*}
  f_{XY}(x,y) = \frac{1}{\sqrt{2\pi}}\exp\left(-\frac{x^2}{2}\right)
  \cdot
  \frac{1}{\sqrt{2\pi}}\exp\left(-\frac{y^2}{2}\right) =
  \frac{1}{2\pi}\exp\left(-\frac{x^2+y^2}{2}\right)
\end{equation*}

\begin{align*}
  f_{UV}(u,v) &= \sum_{i=0}^2 f_{XY}(h_{1i}(u,v),h_{2i}(u,v))|J_i| \\
  &= \frac{1}{2\pi}\exp\left(-\frac{(uv)^2 + v^2}{2}\right)|v| +
  \frac{1}{2\pi}\exp\left(-\frac{(-uv)^2 + (-v)^2}{2}\right)|v| \\
  &= \frac{v}{\pi}\exp\left(-\frac{v^2(u^2+1)}{2}\right)
\end{align*}

\begin{alignat*}{2}
  f_U(u) &= \int_0^\infty
  \frac{v}{\pi}\exp\left(-\frac{v^2(u^2+1)}{2}\right) dv 
  &\qquad(\text{change of variable: $z=v^2$}) \\
  &= \int_0^\infty \frac{1}{2\pi}
  \exp\left(-\frac{u^2+1}{2}z\right) dz 
  & \left(\int_0^\infty\exp(-\alpha z) dz = 1/\alpha\right) \\ 
  &=\frac{1}{\pi}\cdot\frac{1}{u^2+1}
\end{alignat*}
\end{document}
Comments Off on Cauchy distribution: ratio of two gaussian random variables

doc.tex

\documentclass{article}
\usepackage[papersize={200mm, 60mm}, text={190mm, 55mm}]{geometry}
\usepackage{subfigure, tikz}

\begin{document}
\begin{figure}[H]
 \centering
 \subfigure[Original Graph]{\input{graph.tex}}
 \quad
 \subfigure[Independent Set]{\input{ind_set.tex}}
 \quad
 \subfigure[Vertex Cover]{\input{vc.tex}}
 \quad
 \subfigure[Clique]{\input{clique.tex}}
 \caption{Relations among Independent Set, Vertex Cover, and Clique}
\end{figure}

\end{document}

graph.tex

\begin{tikzpicture}
  [
    line/.style = {draw=gray, ultra thick},
  ]

  \coordinate (O) at (-.5cm, .3cm);
  % in polar coordinates system
  \coordinate (A) at (  0: 2cm);
  \coordinate (B) at ( 60: 2cm);
  \coordinate (C) at (120: 2cm);
  \coordinate (D) at (180: 2cm);
  \coordinate (E) at (240: 2cm);
  \coordinate (F) at (300: 2cm);

  % edges
  \path[line] (A) -- (B);
  \path[line] (B) -- (C);
  \path[line] (C) -- (D);
  \path[line] (D) -- (E);
  \path[line] (E) -- (F);
  \path[line] (F) -- (A);
  \path[line] (B) -- (O);
  \path[line] (O) -- (F);
  \path[line] (B) -- (D);
  \path[line] (D) -- (F);

  % nodes
  \shade[ball color=gray] (O) circle (4pt);
  \shade[ball color=gray] (A) circle (4pt);
  \shade[ball color=gray] (B) circle (4pt);
  \shade[ball color=gray] (C) circle (4pt);
  \shade[ball color=gray] (D) circle (4pt);
  \shade[ball color=gray] (E) circle (4pt);
  \shade[ball color=gray] (F) circle (4pt);
\end{tikzpicture}

ind_set.tex

\begin{tikzpicture}
  [
    line/.style = {draw=gray, ultra thick},
  ]

  \coordinate (O) at (-.5cm, .3cm);
  % in polar coordinates system
  \coordinate (A) at (  0: 2cm);
  \coordinate (B) at ( 60: 2cm);
  \coordinate (C) at (120: 2cm);
  \coordinate (D) at (180: 2cm);
  \coordinate (E) at (240: 2cm);
  \coordinate (F) at (300: 2cm);

  % edges
  \path[line] (A) -- (B);
  \path[line] (B) -- (C);
  \path[line] (C) -- (D);
  \path[line] (D) -- (E);
  \path[line] (E) -- (F);
  \path[line] (F) -- (A);
  \path[line] (B) -- (O);
  \path[line] (O) -- (F);
  \path[line] (B) -- (D);
  \path[line] (D) -- (F);

  % nodes
  \shade[ball color=blue!80]  (O) circle (4pt);
  \shade[ball color=blue!80]  (A) circle (4pt);
  \shade[ball color=gray] (B) circle (4pt);
  \shade[ball color=blue!80]  (C) circle (4pt);
  \shade[ball color=gray] (D) circle (4pt);
  \shade[ball color=blue!80]  (E) circle (4pt);
  \shade[ball color=gray] (F) circle (4pt);
\end{tikzpicture}

vc.tex

\begin{tikzpicture}
  [
    line/.style = {draw=gray, ultra thick},
  ]

  \coordinate (O) at (-.5cm, .3cm);
  % in polar coordinates system
  \coordinate (A) at (  0: 2cm);
  \coordinate (B) at ( 60: 2cm);
  \coordinate (C) at (120: 2cm);
  \coordinate (D) at (180: 2cm);
  \coordinate (E) at (240: 2cm);
  \coordinate (F) at (300: 2cm);

  % edges
  \path[line] (A) -- (B);
  \path[line] (B) -- (C);
  \path[line] (C) -- (D);
  \path[line] (D) -- (E);
  \path[line] (E) -- (F);
  \path[line] (F) -- (A);
  \path[line] (B) -- (O);
  \path[line] (O) -- (F);
  \path[line] (B) -- (D);
  \path[line] (D) -- (F);

  % nodes
  \shade[ball color=gray] (O) circle (4pt);
  \shade[ball color=gray] (A) circle (4pt);
  \shade[ball color=red ] (B) circle (4pt);
  \shade[ball color=gray] (C) circle (4pt);
  \shade[ball color=red ] (D) circle (4pt);
  \shade[ball color=gray] (E) circle (4pt);
  \shade[ball color=red ] (F) circle (4pt);
\end{tikzpicture}

clique.tex

\begin{tikzpicture}
  [
    line/.style = {draw=gray, ultra thick},
  ]

  \coordinate (O) at (-.5cm, .3cm);
  % in polar coordinates system
  \coordinate (A) at (  0: 2cm);
  \coordinate (B) at ( 60: 2cm);
  \coordinate (C) at (120: 2cm);
  \coordinate (D) at (180: 2cm);
  \coordinate (E) at (240: 2cm);
  \coordinate (F) at (300: 2cm);

  % edges
  \path[line] (A) -- (O);
  \path[line] (A) -- (C);
  \path[line] (A) -- (D);
  \path[line] (A) -- (E);
  \path[line] (B) -- (E);
  \path[line] (B) -- (F);
  \path[line] (C) -- (A);
  \path[line] (C) -- (E);
  \path[line] (C) -- (F);
  \path[line] (C) -- (O);
  \path[line] (D) -- (O);
  \path[line] (E) -- (O);

  % nodes
  \shade[ball color=green] (O) circle (4pt);
  \shade[ball color=green] (A) circle (4pt);
  \shade[ball color=gray]  (B) circle (4pt);
  \shade[ball color=green] (C) circle (4pt);
  \shade[ball color=gray]  (D) circle (4pt);
  \shade[ball color=green] (E) circle (4pt);
  \shade[ball color=gray]  (F) circle (4pt);
\end{tikzpicture}
Comments Off on Independent Set, Vertex Cover, and Clique

\documentclass[12pt]{article}
\usepackage[papersize={70mm, 35mm}, text={60mm, 25mm}]{geometry}
% For fancy fonts
\usepackage{fontspec}
\defaultfontfeatures{Scale=MatchLowercase, Mapping=tex-text}
\setmainfont[Ligatures={Common}, Numbers={OldStyle}]{Corbel}
\setsansfont[Scale=0.95]{Candara}
\setromanfont{Cambria}
\setmonofont{Monaco}

\usepackage{tikz}

\begin{document}
\pagestyle{empty}
\begin{figure}[h]
  \centering
  \begin{tikzpicture}
    [
      auto,
      line/.style ={draw, thick, -latex, shorten >=2pt},
      block/.style ={rectangle, text width=3em}
    ]
    
    \def\xdst{5cm}
    \def\ydst{-1.8cm}
    
    \node (X) at (0cm, 0cm) {$x$};
    \node (F) at (\xdst, 0cm) {$f(x)$};
    \node (B) at (\xdst, \ydst) {$b$};
    
    \path (X) edge [line, bend angle=10, bend left]
    node [above, midway] {easy} (F);
    \path (F) edge [line, bend angle=10, bend left, dashed, red]
    node [below, midway] {hard} (X);
    \path (X) edge [line, bend angle=15, bend right]
    node [midway, pos=.7,right, yshift=3mm] {easy} (B);
    \path (F) edge [line, dashed, red] node [right] {hard} (B);
  \end{tikzpicture}
\end{figure}
\end{document}
Comments Off on hard-core bits

\documentclass[12pt]{beamer}

% color theme
\usetheme{psu}
\usecolortheme[RGB={0,38,93}]{structure}

% For fancy fonts
\usepackage{fontspec}
\defaultfontfeatures{Scale=MatchLowercase, Mapping=tex-text}
\setmainfont[Ligatures={Common}, Numbers={OldStyle}]{Cambria}
\setsansfont[Scale=0.95]{Candara}
\setromanfont{Cambria}
\setmonofont{Monaco}

\usepackage{tikz}
\usetikzlibrary{arrows}

\newcommand{\TBE}{\textrm{TBE}}
\newcommand{\Sign}{\textrm{Sign}}
\newcommand{\PKE}{\textrm{PKE}}
\newcommand{\Verify}{\textrm{Verify}}

\begin{document}

\begin{frame}
  \frametitle{Canetti-Halevi-Katz Construction}
  \begin{figure}[h]
    \centering
    \begin{tikzpicture}[->,
        >=stealth',
        shorten >= 1pt,
        auto,
        semithick,
        bend angle=15,
      ]
      
      \coordinate (O) at (0cm, 0cm);
      \coordinate (A) at (-1.4cm, .2cm);
      \coordinate (B) at ( 1cm, .2cm);
      
      \tikzstyle{inbox} = [rectangle, draw=red!40!black!50, thick, top
        color=white, bottom color=red!60!blue!50, minimum width=1.5cm,
        minimum height=.8cm, rounded corners];
      \tikzstyle{outbox} = [rectangle, draw=black!50, thick, fill=black!5,
        minimum width=5.6cm, minimum height=2.2cm, rounded corners];
      \tikzstyle{line} = [draw, -latex', very thick]
      \tikzstyle{ann} = [above, text width=5em]
      
      \node [outbox] (PKE) at (O) {};
      \node [inbox] (TBE)  at (A) {\TBE};
      \node [inbox] (Sign) at (B) {\Sign};
      \node (blank) at (-5cm, 0cm) {$\medspace$};
      
      \path [line] (TBE) -- node [midway, above] {$C$} (Sign);
      
      \node (vk) [below of=TBE, node distance=2.6em] {$vk$};
      \path [line] (vk) -- (TBE);
      
      \node (sigk) [below of=Sign, node distance=2.6em] {$sigk$};
      \path [line] (sigk) -- (Sign);
      
      \node (sigma) [right of=Sign, node distance=3.7em] {$\sigma$};
      \path [line] (Sign) -- (sigma);
      
      \node (pk) [above of=TBE, node distance=3.7em] {$pk$};
      \path [line] (pk) -- (TBE);
      
      \node (M) [left of=TBE, node distance=5em] {M};
      \path [line] (M) -- (TBE);
      
      \node (Cpke) [right of=PKE, node distance=10.5em]
            {$\langle C,vk,\sigma\rangle$};
            \path [line] (PKE) -- (Cpke);
            
            \node (label) at (-2.4cm, 1.4cm) {\PKE};
            \node () [below of=PKE, node distance=1.4cm] {Encryption};
    \end{tikzpicture}
    
    \begin{tikzpicture}[->,
        >=stealth',
        shorten >= 1pt,
        auto,
        semithick,
        bend angle=15,
      ]
      
      \coordinate (O) at (0cm, 0cm);
      \coordinate (A) at (-1.2cm, .2cm);
      \coordinate (B) at ( 1.2cm, .2cm);
      
      \tikzstyle{inbox} = [rectangle, draw=red!40!black!50, thick, top
        color=white, bottom color=red!60!blue!50, minimum width=1.5cm,
        minimum height=.8cm, rounded corners];
      \tikzstyle{outbox} = [rectangle, draw=black!50, thick, fill=black!5,
        minimum width=5.6cm, minimum height=2.2cm, rounded corners];
      \tikzstyle{line} = [draw, -latex', very thick]
      \tikzstyle{ann} = [above, text width=5em]
      
      \node [outbox] (PKE) at (O) {};
      \node [inbox] (VFY)  at (A) {\Verify};
      \node [inbox] (TBE) at (B) {\TBE};
      
      \path [line] (VFY) -- node [pos=.7, above] {$C$} (TBE);
      
      \node (vk1) [below of=VFY, node distance=2.6em] {$vk$};
      \path [line] (vk1) -- (VFY);
      
      \node (vk2) [below of=TBE, node distance=2.6em] {$vk$};
      \path [line] (vk2) -- (TBE);
      
      \node (M) [right of=TBE, node distance=3.6em] {\hspace{-1mm}$M$};
      \path [line] (TBE) -- (M);
      
      \node (sk) [above of=TBE, node distance=3.5em] {$sk$};
      \path [line] (sk) -- (TBE);
      
      \node (Cpke) [left of=PKE, node distance=11em] {$\langle C,vk,\sigma\rangle$};
      \path [line] (Cpke) -- (PKE);
      
      \node (sigma) [left of=VFY, node distance=3.5em] {$\sigma$};
      \path [line] (sigma) -- (VFY);
      
      \node (output) [right of=PKE, node distance=10.8em] {$M\medspace$ or $\medspace\perp$};
      \path [line] (PKE) -- (output);
      
      \fill [black] (-1mm,.2cm) circle (2pt);
      \node (no) at (-1mm, -.6cm) {$\perp$};
      \path [line] (-1mm,.2cm) -- (no);
      
      \node (label) at (-2.4cm, 1.4cm) {\PKE};
      \node () [below of=PKE, node distance=1.4cm] {Decryption};
    \end{tikzpicture}
  \end{figure}
\end{frame}
\end{document}
Comments Off on Canetti-Halevi-Katz Construction

\documentclass[12pt]{beamer}

% color theme
\usetheme{psu}
\usecolortheme[RGB={0,38,93}]{structure}

% For fancy fonts
\usepackage{fontspec}
\defaultfontfeatures{Scale=MatchLowercase, Mapping=tex-text}
\setmainfont[Ligatures={Common}, Numbers={OldStyle}]{Cambria}
\setsansfont[Scale=0.95]{Candara}
\setromanfont{Cambria}
\setmonofont{Monaco}

\usepackage{tikz}
\usetikzlibrary{arrows,automata}

\begin{document}

\begin{frame}
  \frametitle{Deterministic Finite Automaton}
  \begin{figure}[h]
    \begin{tikzpicture}[
        % type of arrow head
        >=stealth',
        % keep arrow head from touching the surface
        shorten >= 1pt,
        % automatic node positioning
        auto,
        %                                   
        node distance=2cm,
        % line thickness
        semithick,
        bend angle=15,
        % text for the initial state arrow. I left it as blank
        initial text=]
      \tikzstyle{every state}=[draw=blue!50, thick, fill=blue!20]
      
      \node[state,initial](qe){$q_\epsilon$};
      \node[state,accepting](q0)[above right of=qe]{$q_0$};
      \node[state](q1)[below right of=qe]{$q_1$};
      \node[state](q2)[right of=q0]{$q_2$};
      \node[state,accepting](q3)[right of=q1]{$q_3$};
      \node[state](q4)[below right of=q2]{$q_4$};
      
      \path[->]
      (qe) edge [above left] node {0} (q0)
      (qe) edge [below left] node {1} (q1)
      
      (q0) edge [loop above] node {0} ()
      (q0) edge [left] node {1} (q1)
      
      (q1) edge [above left] node {0} (q2)
      (q1) edge [bend left] node {1} (q3)
      
      (q2) edge [above right] node {0} (q4)
      (q2) edge [above] node {1} (q0)
      
      (q3) edge [bend left] node {0} (q1)
      (q3) edge [right] node {1} (q2)
      
      (q4) edge [below right] node {0} (q3)
      (q4) edge [loop right] node {1} ();
    \end{tikzpicture}    
  \end{figure}
\end{frame}
\end{document}
Comments Off on Deterministic Finite Automaton

doc.tex

\documentclass[12pt]{beamer}

% color theme
\usetheme{psu}
\usecolortheme[RGB={0,38,93}]{structure}

% For fancy fonts
\usepackage{fontspec}
\defaultfontfeatures{Scale=MatchLowercase, Mapping=tex-text} 
\setmainfont[Ligatures={Common}, Numbers={OldStyle}]{Cambria}
\setsansfont[Scale=0.95]{Candara}
\setromanfont{Cambria}
\setmonofont{Monaco}

\usepackage{subfigure}
\usepackage{tikz}

\begin{document}

\begin{frame}
  \frametitle{Goal of ACRE Learning}
  \begin{figure}[h]
    \centering
    \subfigure[Classifier $c$]{\input{fig1.tex}}
    \quad
    \subfigure[Cost Function $a$]{\input{fig2.tex}}
    \\
    \subfigure[Adversary's Goal]{\input{fig3.tex}}
    \quad
    \subfigure[ACRE Learning]{\input{fig4.tex}}
    \caption{Special Case of 2-Dimensional Feature Vectors}
  \end{figure}
\end{frame}
\end{document}

fig1.tex

\begin{tikzpicture}[scale=.95]
  % classifier
  \filldraw [fill=red!20, draw=black, smooth] (0,0) -- (0cm, 2.6cm) --
  (0.2cm, 2.2cm) -- (0.8cm, 2.0cm) -- (1.2, 2.2cm) -- (1.8cm, 1.6cm)
  -- (2.6cm, 0.4cm) -- (3.5cm, 0cm) -- cycle;
 
  % boundary
  \draw (3.5cm, 0cm) -- (3.5cm, 2.6cm) -- (0cm, 2.6cm);
 
  % markers
  \node at (0.2cm, 0.2cm) {\color{red}+};
  \node at (3.3cm, 2.4cm) {\color{blue}-};
\end{tikzpicture}

fig2.tex

\begin{tikzpicture}[scale=.95]
  % boundary
  \draw (0, 0) -- (0cm, 2.6cm) -- (3.5cm, 2.6cm) -- (3.5cm, 0cm) --
  (0, 0);
 
  % classfier
  \filldraw [fill=red!20, draw=black, smooth] (0,0) -- (0cm, 2.6cm) --
  (0.2cm, 2.2cm) -- (0.8cm, 2.0cm) -- (1.2, 2.2cm) -- (1.8cm, 1.6cm)
  -- (2.6cm, 0.4cm) -- (3.5cm, 0cm) -- cycle;
 
  % cost functions
  \draw (2cm, 1.3cm) ellipse (1cm and .7cm);
  \draw (1.9cm, 1.3cm) ellipse (.8cm and .5cm);
  \draw (1.9cm, 1.3cm) ellipse (.6cm and .2cm);
  \draw (1.8cm, 1.3cm) ellipse (.3cm and .1cm);
  \draw (1.7cm, 1.3cm) ellipse (.12cm and .05cm);
  \draw (2cm, 1.6cm) ellipse (.1cm and .05cm);
\end{tikzpicture}

fig3.tex

\begin{tikzpicture}[scale=.95]
  % boundary
  \draw (0, 0) -- (0cm, 2.6cm) -- (3.5cm, 2.6cm) -- (3.5cm, 0cm) --
  (0, 0);
 
  % classfier
  \filldraw [fill=red!20, draw=black, smooth] (0,0) -- (0cm, 2.6cm) --
  (0.2cm, 2.2cm) -- (0.8cm, 2.0cm) -- (1.2, 2.2cm) -- (1.8cm, 1.6cm)
  -- (2.6cm, 0.4cm) -- (3.5cm, 0cm) -- cycle;
 
  % cost functions
  \draw (2cm, 1.3cm) ellipse (1cm and .7cm);
  \draw (1.9cm, 1.3cm) ellipse (.8cm and .5cm);
  \draw (1.9cm, 1.3cm) ellipse (.6cm and .2cm);
  \draw (1.8cm, 1.3cm) ellipse (.3cm and .1cm);
  \draw (1.85cm, 1.3cm) ellipse (.12cm and .05cm);
  \draw (2cm, 1.6cm) ellipse (.1cm and .05cm);
 
  % star
  \filldraw [orange] (2.05cm, 1.3cm) circle (.05cm);
\end{tikzpicture}

fig4.tex

\begin{tikzpicture}
  [
    scale=.95,
    circle/.style={shape=circle, minimum size=1mm, text centered},
    instance/.style={shape=circle, minimum size=1mm, text centered}
    ]
 
  % boundary
  \draw (0, 0) -- (0cm, 2.6cm) -- (3.5cm, 2.6cm) -- (3.5cm, 0cm) --
  (0, 0);
 
  % cost functions
  \draw (2cm, 1.3cm) ellipse (1cm and .7cm);
  \draw (1.9cm, 1.3cm) ellipse (.8cm and .5cm);
  \draw (1.9cm, 1.3cm) ellipse (.6cm and .2cm);
  \draw (1.8cm, 1.3cm) ellipse (.3cm and .1cm);
  \draw (1.7cm, 1.3cm) ellipse (.12cm and .05cm);
  \draw (2cm, 1.6cm) ellipse (.1cm and .05cm);
 
  % yes-instance
  \node [instance] at (0.5cm, 0.5cm) {\color{red}$x^+$};
  % no-instance
  \node [instance] at (2.5cm, 2.3cm) {\color{blue}$x^-$};
 
  % queries
  \node [circle] at (  2cm,   2cm) {\color{orange}?};
  \node [circle] at (1.5cm, 0.8cm) {\color{orange}?};
  \node [circle] at (2.7cm, 0.5cm) {\color{orange}?};
  \node [circle] at (0.5cm, 2.3cm) {\color{orange}?};
  \node [circle] at (  3cm, 1.5cm) {\color{orange}?};
  \node [circle] at (2.3cm, 1.5cm) {\color{orange}?};
  \node [circle] at (1.7cm, 1.3cm) {\color{orange}?};
\end{tikzpicture}
Comments Off on ACRE Learning: subfigure