
\newcommand{\thistitle}{Lecture 3: Basics of Microeconomics}

\input{title.tex}

% Editable curves for the cubic example used throughout this lecture.
\pgfmathdeclarefunction{eecmc}{1}{\pgfmathparse{#1^2-4*#1+5}}
\pgfmathdeclarefunction{eecvar}{1}{\pgfmathparse{#1^3/3-2*#1^2+5*#1}}
\pgfmathdeclarefunction{eecavc}{1}{\pgfmathparse{#1^2/3-2*#1+5}}
\pgfmathdeclarefunction{eecac}{1}{\pgfmathparse{eecavc(#1)+15/#1}}
\def\eebreakq{4.24727416}
\pgfmathsetmacro{\eebreakp}{eecmc(\eebreakq)}
% 0: cost curves; 1: competitive optimum; 2: shutdown threshold;
% 3: break-even; 4: all three reference points.
\newcommand{\eecostdiagram}[1]{%
\begin{tikzpicture}
\begin{axis}[
  width=12.1cm,height=5.4cm,axis lines=left,
  xlabel={quantity $Q$},ylabel={EUR per unit},
  xmin=0,xmax=6.4,ymin=0,ymax=13,
  xtick={0,1,...,6},ytick={0,2,...,12},
  samples=100,domain=.25:6.3,clip=true,
  label style={font=\small},tick label style={font=\scriptsize},
  legend style={font=\scriptsize,draw=none,fill=white,at={(.02,.98)},anchor=north west},
  legend cell align=left]
\addplot[green!55!black,very thick] {eecmc(x)};
\addlegendentry{$MC=C'(Q)$}
\ifnum#1=1\else
  \addplot[purple,thick,dashed] {eecavc(x)};
  \addlegendentry{$AVC=C_{\mathrm{var}}(Q)/Q$}
  \ifnum#1=2\else
    \addplot[blue,thick,dashdotted,domain=1.5:6.3] {eecac(x)};
    \addlegendentry{$AC=C(Q)/Q$}
  \fi
\fi
\ifnum#1=1
  \addplot[TUred,thick,domain=0:6.3] {10};
  \addlegendentry{market price $p=10$}
  \draw[densely dotted] (axis cs:5,0)--(axis cs:5,10);
  \fill[TUred] (axis cs:5,10) circle (2pt);
  \node[anchor=north,font=\small] at (axis cs:5,0) {$Q^*=5$};
\fi
\ifnum#1=2\ifnum#1=4\else
  \draw[densely dotted] (axis cs:0,2)--(axis cs:3,2)--(axis cs:3,0);
  \fill[TUred] (axis cs:3,2) circle (2pt);
  \node[anchor=south east,font=\small] at (axis cs:3,2) {$C$};
  \node[anchor=north,font=\small] at (axis cs:3,0) {$Q_{\mathrm{prod}}=3$};
\fi\fi
\ifnum#1=3\ifnum#1=4\else
  \draw[densely dotted] (axis cs:0,\eebreakp)--(axis cs:\eebreakq,\eebreakp)
    --(axis cs:\eebreakq,0);
  \fill[TUred] (axis cs:\eebreakq,\eebreakp) circle (2pt);
  \node[anchor=south east,font=\small] at (axis cs:\eebreakq,\eebreakp) {$B$};
  \node[anchor=north,font=\small] at (axis cs:\eebreakq,0) {$Q_{\mathrm{break}}$};
\fi\fi
\ifnum#1=4
  \draw[densely dotted] (axis cs:0,2)--(axis cs:3,2)--(axis cs:3,0);
  \draw[densely dotted] (axis cs:0,\eebreakp)--(axis cs:\eebreakq,\eebreakp)
    --(axis cs:\eebreakq,0);
  \addplot[TUred,thick,domain=0:6.3] {10};
  \addlegendentry{market price $p=10$}
  \draw[densely dotted] (axis cs:5,0)--(axis cs:5,10);
  \fill[TUred] (axis cs:3,2) circle (2pt);
  \fill[TUred] (axis cs:\eebreakq,\eebreakp) circle (2pt);
  \fill[TUred] (axis cs:5,10) circle (2pt);
  \node[anchor=south west,font=\small] at (axis cs:3,2) {$C$};
  \node[anchor=south east,font=\small] at (axis cs:\eebreakq,\eebreakp) {$B$};
  \node[anchor=south west,font=\small] at (axis cs:5,10) {$A$};
\fi
\end{axis}
\end{tikzpicture}}

\newcommand{\eecostsupplydiagram}{%
\begin{tikzpicture}
\begin{axis}[
  width=12.1cm,height=5.0cm,axis lines=left,
  xlabel={quantity $Q$},ylabel={price $p$ [EUR per unit]},
  xmin=0,xmax=6.4,ymin=0,ymax=13,
  xtick={0,1,...,6},ytick={0,2,...,12},
  samples=100,clip=true,
  label style={font=\small},tick label style={font=\scriptsize},
  legend style={font=\scriptsize,draw=none,fill=white,
    at={(.02,.98)},anchor=north west},legend cell align=left]
  \addplot[purple,thick,dashed,domain=.25:6.3] {eecavc(x)};
  \addlegendentry{$AVC=C_{\mathrm{var}}(Q)/Q$}
  \addplot[gray,thick,dashed,domain=0:3] {eecmc(x)};
  \addlegendentry{marginal cost below threshold}
  \addplot[green!55!black,very thick,domain=3:6.3] {eecmc(x)};
  \addlegendentry{inverse supply $p(Q)=MC(Q)$}
  \draw[densely dotted] (axis cs:0,2)--(axis cs:3,2)--(axis cs:3,0);
  \fill[TUred] (axis cs:3,2) circle (2pt);
  \node[anchor=south west,font=\small] at (axis cs:3,2) {$C$};
\end{axis}
\end{tikzpicture}}


\section{Types of Markets}

\begin{frame}
  \frametitle{The role of markets}

  A \alert{market} is where a group of sellers/producers and a group of buyers/consumers
  of a particular good or service come together for exchange.

  Wherever there is \alert{scarcity} we have an \alert{allocation}
  question: who should consume, and who should produce?

  And at what \alert{price}?

  Economists measure \alert{efficiency} based on how well an allocation maximises
  \alert{economic welfare}.
\end{frame}


\begin{frame}
  \frametitle{Monopoly versus perfect competition}

  \centering
  \begin{tikzpicture}[x=1cm,y=1cm,font=\small]
    \fill[blue!20] (-1.8,0) rectangle (0,4.5);
    \fill[blue!20] (0,3.3) rectangle (10.5,4.5);
    \fill[gray!20] (0,2.2) rectangle (3.5,3.3);
    \fill[gray!20] (7,2.2) rectangle (10.5,3.3);
    \fill[gray!20] (0,0) rectangle (3.5,1.1);
    \fill[gray!20] (7,0) rectangle (10.5,1.1);
    \foreach \x in {0,3.5,7}\draw[white,line width=3pt] (\x,0)--(\x,4.5);
    \foreach \y in {1.1,2.2,3.3}\draw[white,line width=3pt] (-1.8,\y)--(10.5,\y);
    \node[font=\bfseries] at (5.25,4.8) {Sellers};
    \node[rotate=90,font=\bfseries] at (-2.2,1.65) {Buyers};
    \node at (-.9,3.9) {Number};
    \foreach \x/\label in {1.75/one,5.25/few,8.75/many}
      \node at (\x,3.9) {\label};
    \foreach \y/\label in {2.75/one,1.65/few,.55/many}
      \node at (-.9,\y) {\label};
    \node[align=center] at (1.75,2.75) {Bilateral\\monopoly};
    \node at (8.75,2.75) {Monopsony};
    \node at (1.75,.55) {Monopoly};
    \node[align=center] at (8.75,.55) {Perfect\\competition};
    \node at (5.25,1.65) {Oligopolistic market structures};
  \end{tikzpicture}

\end{frame}


\begin{frame}
  \frametitle{Monopoly versus perfect competition}

  For \alert{perfect competition} to apply we need:
  \begin{itemize}
  \item \alert{many buyers and many sellers} so nobody can influence the price, i.e. all actors are \alert{price takers}
  \item goods are exactly the same, i.e.  \alert{homogeneous goods}
  \item all actors have \alert{perfect information}
   \item \alert{no entry or exit barriers}
  \end{itemize}

  In a \alert{monopoly} there is a \alert{single seller}:
  \begin{itemize}
  \item Seller is \alert{sole producer} and can influence the price of its output
    \item Seller has \alert{market power}: the ability to maintain a price above the price under competition
  \end{itemize}
\end{frame}


\section{Perfect Competition}



%example graphics taken from
%https://texample.net/tikz/examples/area/economics/
%https://texample.net/tikz/examples/is-lm-diagram/
%https://www.economics.utoronto.ca/blanchenay/latex/
%http://static.latexstudio.net/wp-content/uploads/2016/06/tikzforeconomists-110619150244-phpapp01.pdf


\begin{frame}
  \frametitle{Inverse supply functions}

  Each producing firm has its own \alert{inverse supply function} which shows at
  which price $p$ it is worthwhile to sell a given quantity $Q_S$. It indicates
  the \alert{marginal cost} of the next unit of production at a given
  production level of $Q_S$ units. Generally: the higher the quantity, the higher the price.

  (It's the \emph{inverse} because the supply function is the quantity as a function of price  $Q_S(p)$.)

  \centering
\begin{tikzpicture}[
    scale=1.2,
    demand/.style={blue, thick},
    supply/.style={red, thick},
    axis/.style={very thick, ->, >=stealth', line join=miter},
    important line/.style={thick}, dashed line/.style={dashed, thin},
    every node/.style={color=black},
    dot/.style={circle,fill=black,minimum size=4pt,inner sep=0pt,
      outer sep=-1pt},
  ]
  % axis
  \draw[axis,<->] (2.5,0) node(xline)[right] {quantity $Q$} -|
  (0,2.5) node(yline)[above] {price $p$};
  % demand-supply diagram
  \draw[supply] (0,0.8) coordinate (supply_1) parabola (1.8,1.8)
  coordinate (supply_2) node[above] {inverse supply $p(Q_S)$};

\end{tikzpicture}

\end{frame}


\begin{frame}
  \frametitle{Inverse supply function: example}

  A generation firm has two coal plants. The new plant can produce
  1000~MW at a cost of 10~\euro/MWh. An older less efficient plant can produce only 500~MW
  at a cost of 15~\euro/MWh.

  What does the supply curve look like?

  \pause

  \centering
\begin{tikzpicture}[
    scale=1.2,
    demand/.style={blue, thick},
    supply/.style={red, thick},
    axis/.style={very thick, ->, >=stealth', line join=miter},
    important line/.style={thick}, dashed line/.style={dashed, thin},
    every node/.style={color=black},
    dot/.style={circle,fill=black,minimum size=4pt,inner sep=0pt,
      outer sep=-1pt},
  ]
  % axis
  \draw[axis,<->] (4,0) node(xline)[right] {quantity $Q$ (MW)} -|
  (0,2.5) node(yline)[above] {price $p$ (\euro/MWh)};
  % demand-supply diagram
  \draw[supply] (0,1) -- (2,1) -- (2,1.5) -- (3,1.5)  node[right,red] {inverse supply $p(Q_S)$};

  \node[left] at (0,1.5) {15};
  \node[left] at (0,1) {10};
  \node[below] at (2,0) {1000};
  \node[below] at (3,0) {1500};

  \draw[dashed] (2,0) -- (2,2.5);
  \draw[dashed] (3,0) -- (3,2.5);

\end{tikzpicture}

\end{frame}




\begin{frame}
  \frametitle{Aggregation of inverse supply functions}

  If many firms are active, we can sort and aggregate their inverse supply functions into a single supply function for the whole market.

  \centering
\begin{tikzpicture}[
    scale=0.8,
    demand/.style={blue, thick},
    supply/.style={red, thick},
    axis/.style={very thick, ->, >=stealth', line join=miter},
    important line/.style={thick}, dashed line/.style={dashed, thin},
    every node/.style={color=black},
    dot/.style={circle,fill=black,minimum size=4pt,inner sep=0pt,
      outer sep=-1pt},
  ]

  \begin{scope}[xshift=0cm]
  % axis
  \node at (1.2,3) {firm 1};
  \draw[axis,<->] (2.5,0) node(xline)[right] {$Q$} -|
  (0,2.5) node(yline)[above] {$p$};
  % diagram
  \draw[supply] (0,0.4) coordinate (supply_1) parabola (1.8,1.8)
  coordinate (supply_2) node[above] { $p_1(Q_S)$};
  \end{scope}
  \begin{scope}[xshift=4cm]
  % axis
  \node at (1.2,3) {firm 2};
  \draw[axis,<->] (2.5,0) node(xline)[right] {$Q$} -|
  (0,2.5) node(yline)[above] {$p$};
  % diagram
  \draw[supply] (0,0.1) coordinate (supply_1) parabola (1.8,1.4)
  coordinate (supply_2) node[above] {$p_2(Q_S)$};
  \end{scope}
  \begin{scope}[xshift=8cm]
  % axis
  \node at (1.2,3) {firm 3};
  \draw[axis,<->] (2.5,0) node(xline)[right] {$Q$} -|
  (0,2.5) node(yline)[above] {$p$};
  % diagram
  \draw[supply] (0,0.6) coordinate (supply_1) parabola (1.8,2.1)
  coordinate (supply_2) node[above] {$p_3(Q_S)$};
  \end{scope}

  \begin{scope}[xshift=4cm,yshift=-4cm]
  % axis
  \node at (2,3) {all firms};
  \draw[axis,<->] (4,0) node(xline)[right] {$Q$} -|
  (0,2.5) node(yline)[above] {$p$};
  % diagram
  \draw[supply] (0,0.1) coordinate (supply_1) parabola (3.8,1.8)
  coordinate (supply_2) node[above] {$p(Q_S)$};
  \end{scope}


  \draw[->, very thick, orange, >=stealth']
  (1.5,-0.1) -- (3,-1);
  \draw[->, very thick, orange, >=stealth']
  (5.5,-0.1) -- (5.5,-0.6);
  \draw[->, very thick, orange, >=stealth']
  (9.5,-0.1) -- (8,-1);
\end{tikzpicture}

\end{frame}


\begin{frame}
  \frametitle{Example 1: Worldwide aggregated supply curve for copper}

  Copper is an important component of electrical machinery and distribution.

  \centering
  \includegraphics[height=7cm]{images_2015_April_2015_Departments_M_SNL-Copper.jpg}


\end{frame}


\begin{frame}
  \frametitle{Example 2: Worldwide aggregated supply function for oil}

  Boxes indicate ranges for each supply source of oil.

  \centering
  \includegraphics[height=7cm]{oil_supply_curve.png}


\end{frame}


\begin{frame}
  \frametitle{Example 3: German aggregated supply function for electricity}

  \centering
  \includegraphics[height=7.7cm]{demand-supply.pdf}


\end{frame}


\begin{frame}
  \frametitle{Supply side: direct versus opportunity costs}

  The price at which a seller is willing to sell their goods is determined by their costs of production:
  \begin{itemize}
  \item \alert{Explicit, direct costs}: out-of-pocket expenses, money actually paid e.g. for materials, energy
  \item \alert{Opportunity costs}: fictive costs representing the potential benefit or income that is
    foregone as a result of selecting one alternative over another when there is scarcity
  \end{itemize}

  Examples:
  \begin{itemize}
  \item \alert{Scarce time}: Going to cinema instead of working: direct cost is ticket 10~\euro, opportunity cost is 40~\euro{} one could have earned by working instead; total cost: 50~\euro{}
  \item \alert{Scarce money}: Investing in rooftop solar instead of savings account: direct cost is price of solar panel, opportunity cost is the interest you could have earned; have to factor interest in comparison
  \end{itemize}


\end{frame}

\begin{frame}{Opportunity costs example: reservoir hydroelectricity}
  \small
  A hydroelectric dam has enough water stored to feed into the grid for one hour (\alert{scarce water}). There are no fuel costs or other direct marginal costs. So you might think we should feed in at midday when the electricity price is 50~\euro/MWh. However, then we miss the chance to feed in later when the price is 125~\euro/MWh. These are the \alert{opportunity costs} of foregoing later feed-in, which we have to take into account in our production costs. Once included, one would bid with marginal costs of 125~\euro/MWh, which makes sure we only feed-in at the best time in the evening.
\begin{center}
\includegraphics[height=4cm]{18_Staudamm_Wasserkraftwerk_iStock-poplasen-1024x576.jpg}\hspace{.5cm}
\includegraphics[height=4cm]{strompreis-verlauf-251011.png}
\end{center}
\end{frame}

\begin{frame}
  \frametitle{Inverse demand functions}

  Each consumer has its own \alert{inverse demand function} which
  shows which price $p$ it is prepared to pay for a given quantity
  $Q_D$. It indicates the \alert{willingness to pay} or \alert{marginal utility} of the next unit of
  consumption at a given consumption level of $Q_D$ units. Generally:
  the higher the quantity, the lower the price.

  (It's the \emph{inverse} because the demand function is the quantity as a function of price $Q_D(p)$.)

  \centering
\begin{tikzpicture}[
    scale=1.2,
    demand/.style={blue, thick},
    supply/.style={red, thick},
    axis/.style={very thick, ->, >=stealth', line join=miter},
    important line/.style={thick}, dashed line/.style={dashed, thin},
    every node/.style={color=black},
    dot/.style={circle,fill=black,minimum size=4pt,inner sep=0pt,
      outer sep=-1pt},
  ]
  % axis
  \draw[axis,<->] (2.5,0) node(xline)[right] {quantity $Q$} -|
  (0,2.5) node(yline)[above] {price $p$};
  % demand-supply diagram
  \draw[demand] (0,2) coordinate (demand_1) parabola[bend at end]
           (1.8,.5) coordinate (demand_2) node[right] {inverse demand $p(Q_D)$};

\end{tikzpicture}

\end{frame}


\begin{frame}
  \frametitle{Inverse demand function: example}


  After sport I'm hungry and thirsty. I visit a stand selling
  oranges. The first orange is worth a lot to me. It partially
  satisfies my hunger and thirst, so the second is worth less to
  me. By the 3rd orange, I'm full.

  \centering
\begin{tikzpicture}[
    scale=1.2,
    demand/.style={blue, thick},
    supply/.style={red, thick},
    axis/.style={very thick, ->, >=stealth', line join=miter},
    important line/.style={thick}, dashed line/.style={dashed, thin},
    every node/.style={color=black},
    dot/.style={circle,fill=black,minimum size=4pt,inner sep=0pt,
      outer sep=-1pt},
  ]
  % axis
  \draw[axis,<->] (4,0) node(xline)[right] {quantity $Q$ (oranges)} -|
  (0,2.5) node(yline)[above] {price $p$ (\euro/orange)};
  % demand-supply diagram
  \draw[demand] (0,2) coordinate (demand_1) parabola[bend at end]
           (3,0) coordinate (demand_2);
  \node[below] at (1,0) {1};
  \node[below] at (2,0) {2};
  \node[below] at (3,0) {3};

\end{tikzpicture}

\end{frame}



\begin{frame}
  \frametitle{Inverse demand: example}

  Electrolysis is used to produce aluminium from bauxite ore. On the open market aluminium sells for \euro1200/tonne.
  The cost of materials is \euro600/tonne, which leaves \euro600/tonne to pay for electricity.
  A firm has two electrolysis units. A newer efficient one with capacity 1000~tonne/hour consumes 15~MWh/tonne, while an older inefficient one with capacity 500~tonne/hour consumes 20~MWh/tonne. How much are they willing to pay for electricity?

  \pause

  New: $\frac{600 \textrm{\euro/t}}{15 \textrm{MWh/t}} = 40$\euro/MWh, old $\frac{600 \textrm{\euro/t}}{20 \textrm{MWh/t}} = 30$\euro/MWh.

  \centering
\begin{tikzpicture}[
    scale=1.2,
    demand/.style={blue, thick},
    supply/.style={red, thick},
    axis/.style={very thick, ->, >=stealth', line join=miter},
    important line/.style={thick}, dashed line/.style={dashed, thin},
    every node/.style={color=black},
    dot/.style={circle,fill=black,minimum size=4pt,inner sep=0pt,
      outer sep=-1pt},
  ]
  % axis
  \draw[axis,<->] (4,0) node(xline)[right] {quantity $Q$ (tonne/hour)} -|
  (0,2.5) node(yline)[above] {price $p$ (\euro/MWh)};
  % demand-supply diagram
  \draw[demand] (0,2) -- (2,2) -- (2,1.5) -- (3,1.5)  node[right,blue] {inverse demand $p(Q_D)$};

  \node[left] at (0,2) {40};
  \node[left] at (0,1.5) {30};

  \draw[dashed] (2,0) -- (2,2.5);
  \draw[dashed] (3,0) -- (3,2.5);
  \node[below] at (2,0) {1000};
  \node[below] at (3,0) {1500};


\end{tikzpicture}

\end{frame}




\begin{frame}
  \frametitle{Aggregation of inverse demand functions}

  If many consumers are active, we can sort and aggregate their inverse demand functions into a single demand function for the whole market.

  \centering
\begin{tikzpicture}[
    scale=0.8,
    demand/.style={blue, thick},
    supply/.style={red, thick},
    axis/.style={very thick, ->, >=stealth', line join=miter},
    important line/.style={thick}, dashed line/.style={dashed, thin},
    every node/.style={color=black},
    dot/.style={circle,fill=black,minimum size=4pt,inner sep=0pt,
      outer sep=-1pt},
  ]

  \begin{scope}[xshift=0cm]
  % axis
  \node at (1.3,3) {consumer 1};
  \draw[axis,<->] (2.5,0) node(xline)[right] {$Q$} -|
  (0,2.5) node(yline)[above] {$p$};
  % diagram
  \draw[demand] (0,2) coordinate (demand_1) parabola[bend at end]
           (1.8,.7) coordinate (demand_2) node[right] {$p_1(Q_D)$};
  \end{scope}
  \begin{scope}[xshift=4cm]
  % axis
  \node at (1.3,3) {consumer 2};
  \draw[axis,<->] (2.5,0) node(xline)[right] {$Q$} -|
  (0,2.5) node(yline)[above] {$p$};
  % diagram
  \draw[demand] (0,1.5) coordinate (demand_1) parabola[bend at end]
           (1.8,0.5) coordinate (demand_2) node[right] {$p_2(Q_D)$};
  \end{scope}
  \begin{scope}[xshift=8cm]
  % axis
  \node at (1.3,3) {consumer 3};
  \draw[axis,<->] (2.5,0) node(xline)[right] {$Q$} -|
  (0,2.5) node(yline)[above] {$p$};
  % diagram
  \draw[demand] (0,1.8) coordinate (demand_1) parabola[bend at end]
           (1.8,1.3) coordinate (demand_2) node[right] {$p_3(Q_D)$};
  \end{scope}

  \begin{scope}[xshift=4cm,yshift=-4cm]
  % axis
  \node at (2,3) {all consumers};
  \draw[axis,<->] (4,0) node(xline)[right] {$Q$} -|
  (0,2.5) node(yline)[above] {$p$};
  % diagram
  \draw[demand] (0,2) coordinate (demand_1) parabola[bend at end]
           (4,0.5) coordinate (demand_2) node[right] {$p(Q_D)$};
  \end{scope}


  \draw[->, very thick, orange, >=stealth']
  (1.5,-0.1) -- (3,-1);
  \draw[->, very thick, orange, >=stealth']
  (5.5,-0.1) -- (5.5,-0.6);
  \draw[->, very thick, orange, >=stealth']
  (9.5,-0.1) -- (8,-1);
\end{tikzpicture}

\end{frame}





\begin{frame}
  \frametitle{Market clearing price and volume}

  In a competitive market the \alert{market clearing price} (MCP) and
  the \alert{market clearing volume} (MCV) are set by the intersection
  of the inverse supply and demand functions.

  \centering
\begin{tikzpicture}[
    scale=2,
    demand/.style={blue, thick},
    supply/.style={red, thick},
    axis/.style={very thick, ->, >=stealth', line join=miter},
    important line/.style={thick}, dashed line/.style={dashed, thin},
    every node/.style={color=black},
    dot/.style={circle,fill=black,minimum size=4pt,inner sep=0pt,
      outer sep=-1pt},
  ]
  % axis
  \draw[axis,<->] (2.5,0) node(xline)[right] {quantity $Q$} -|
  (0,2.5) node(yline)[above] {price $p$};
  % demand-supply diagram
  \draw[supply] (0,0.1) coordinate (supply_1) parabola (1.8,1.8)
  coordinate (supply_2) node[above] {inverse supply $p(Q_S)$};
  \draw[demand] (0,2) coordinate (demand_1) parabola[bend at end]
           (1.8,.5) coordinate (demand_2) node[right] {inverse demand $p(Q_D)$};
  \draw[dashed line]
  (0,0.75) node[left]{$MCP$} -- (1.1,0.75) node[dot]{} -- (1.1,0) node[below]{$MCV$};

\end{tikzpicture}
\end{frame}




\begin{frame}
  \frametitle{Market clearing price and volume: important properties}

\begin{columns}[T]
  \begin{column}{7cm}

\begin{tikzpicture}[
    scale=2,
    demand/.style={blue, thick},
    supply/.style={red, thick},
    axis/.style={very thick, ->, >=stealth', line join=miter},
    important line/.style={thick}, dashed line/.style={dashed, thin},
    every node/.style={color=black},
    dot/.style={circle,fill=black,minimum size=4pt,inner sep=0pt,
      outer sep=-1pt},
  ]
  % axis
  \draw[axis,<->] (2.5,0) node(xline)[right] {quantity $Q$} -|
  (0,2.5) node(yline)[above] {price $p$};
  % demand-supply diagram
  \draw[supply] (0,0.1) coordinate (supply_1) parabola (1.8,1.8)
  coordinate (supply_2) node[above] {$p(Q_S)$};
  \draw[demand] (0,2) coordinate (demand_1) parabola[bend at end]
           (1.8,.5) coordinate (demand_2) node[right] {$p(Q_D)$};
  \draw[dashed line]
  (0,0.75) node[left]{$MCP$} -- (1.1,0.75) node[dot]{} -- (1.1,0) node[below]{$MCV$};

\end{tikzpicture}


  \end{column}
  \begin{column}{7cm}
    \begin{itemize}
      \item Every actor sees the same price.
      \item The price arises \alert{decentrally} from the interaction of supply and demand curves.
      \item The same amount is supplied as is consumed.
      \item Since there are many suppliers and consumers, no single actor can influence the price (they are all \alert{price takers}).
      \item The price is higher than the costs of each supplier whose offer is taken.
      \item The price is lower than the willingness to pay of each consumer whose bid is taken.
    \end{itemize}

  \end{column}

\end{columns}

\end{frame}




\begin{frame}
  \frametitle{Market clearing price and volume: simple example}

  Consider a market with:

  Aggregated inverse demand curve $p_D(Q_D) = 28 - 4Q_D$.

  Aggregated inverse supply curve $p_S(Q_S) = 1 + 5Q_S$.

  Q: What is the market clearing price and volume?

  Solve
  \begin{equation*}
    28 - 4Q = 1 + 5Q
  \end{equation*}
  Find $Q^*=3, p^* = 16$.


\end{frame}

\begin{frame}
  \frametitle{Price finding as an equilibrium}

  The price finding mechanism is often called an \alert{equilibrium}
  in analogy to physics because the `forces' of supply and demand are equal.

  In physics, a \alert{stable equilibrium} (like a pendulum) has negative feedback that returns the system to equilibrium after a disturbance. An \alert{unstable equilibrium} (like a pencil on its end) would not return to its equilibrium.

  A market equilibrium is \alert{stable} because the
  market actors have no incentive to change their behaviour, since
  they are already optimally adapted to the relevant market data.

  \vspace{.2cm}

  \centering
  \includegraphics[height=3cm]{pendulum.png}
  \hspace{2cm}
  \includegraphics[height=3cm]{pencil.jpg}

\end{frame}

\begin{frame}{The role of competition}

  Competition for the favour of consumers creates \alert{incentives to reduce prices and improve products}. Otherwise producers would not sell their products. Firms must constantly improve, creating \alert{incentives for innovation}. Competition can unleash world-changing dynamics.
\begin{center}\includegraphics[height=5.5cm]{ember-learning-pv-2023.jpg}\end{center}
\end{frame}


\begin{frame}
  \frametitle{Reaction to increase in demand}

  If demand increases in volume and/or willingness to pay, the price goes up.


  \centering
\begin{tikzpicture}[
    scale=2,
    demand/.style={blue, thick, opacity=0.5},
    new demand/.style={blue, thick},
    supply/.style={red, thick},
    axis/.style={very thick, ->, >=stealth', line join=miter},
    important line/.style={thick}, dashed line/.style={dashed, thin},
    every node/.style={color=black},
    dot/.style={circle,fill=black,minimum size=4pt,inner sep=0pt,
      outer sep=-1pt},
  ]
  % axis
  \draw[axis,<->] (2.5,0) node(xline)[right] {quantity $Q$} -|
  (0,2.5) node(yline)[above] {price $p$};
  % demand-supply diagram
  \draw[supply] (0,0.1) coordinate (supply_1) parabola (1.8,1.8)
  coordinate (supply_2) node[above] {};
  \draw[demand] (0,2) coordinate (demand_1) parabola[bend at end]
           (1.8,.5) coordinate (demand_2) node[right] {};
  \draw[new demand] (0.5,2.3) coordinate (demand_1) parabola[bend at end]
           (2.3,.8) coordinate (demand_2) node[right] {};
  \draw[dashed line]
  (0,0.75) node[left]{$p_0$} -- (1.1,0.75) node[dot]{} -- (1.1,0) node[below]{$Q_0$};
  \draw[dashed line]
  (0,1.15) node[left]{$p_1$} -- (1.41,1.15) node[dot]{} -- (1.41,0) node[below]{$Q_1$};

  \draw[->, very thick, blue, >=stealth']
  (0.5,1.3) -- (0.93,1.63);

\end{tikzpicture}
\end{frame}




\begin{frame}
  \frametitle{Reaction to increase in supply cost}

  If supply becomes more expensive or decreases in volume, the price goes up.


  \centering
\begin{tikzpicture}[
    scale=2,
    demand/.style={blue, thick},
    supply/.style={red, thick, opacity=0.5},
    new supply/.style={red, thick},
    axis/.style={very thick, ->, >=stealth', line join=miter},
    important line/.style={thick}, dashed line/.style={dashed, thin},
    every node/.style={color=black},
    dot/.style={circle,fill=black,minimum size=4pt,inner sep=0pt,
      outer sep=-1pt},
  ]
  % axis
  \draw[axis,<->] (2.5,0) node(xline)[right] {quantity $Q$} -|
  (0,2.5) node(yline)[above] {price $p$};
  % demand-supply diagram
  \draw[supply] (0,0.1) coordinate (supply_1) parabola (1.8,1.8)
  coordinate (supply_2) node[above] {};
  \draw[new supply] (0,0.6) coordinate (supply_1) parabola (1.8,2.5)
  coordinate (supply_2) node[above] {};
  \draw[demand] (0,2) coordinate (demand_1) parabola[bend at end]
           (1.8,.5) coordinate (demand_2) node[right] {};
  \draw[dashed line]
  (0,0.75) node[left]{$p_0$} -- (1.1,0.75) node[dot]{} -- (1.1,0) node[below]{$Q_0$};
  \draw[dashed line]
  (0,0.97) node[left]{$p_1$} -- (0.8,0.97) node[dot]{} -- (0.8,0) node[below]{$Q_1$};

  \draw[->, very thick, red, >=stealth']
  (1.55,1.35) -- (1.3,1.6);

\end{tikzpicture}
\end{frame}






\begin{frame}
  \frametitle{Consumer and producer surpluses}


  The \alert{consumer surplus (CS)} is the total amount consumers are willing to pay minus what they actually pay.
  The \alert{producer surplus (PS)} is the total revenue for producers minus their actual costs.
  The \alert{total surplus} or \alert{total welfare} $TW = CS + PS$ indicates the degree of efficiency of resource allocation.

  \centering
  \begin{tikzpicture}[x=2.5cm,y=1.65cm,font=\small]
    \pgfmathsetmacro{\qeq}{(-5.4+sqrt(5.4^2+4*.2*6.156))/.4}
    \pgfmathsetmacro{\peq}{.1+1.7*\qeq^2/3.24}
    \fill[blue!25] (0,\peq)--(0,2)
      --plot[domain=0:\qeq,samples=60] (\x,{.5+1.5*(1.8-\x)^2/3.24})--cycle;
    \fill[red!25] (0,\peq)--(0,.1)
      --plot[domain=0:\qeq,samples=60] (\x,{.1+1.7*\x^2/3.24})--cycle;
    \draw[->,very thick] (0,0)--(2.2,0) node[right] {quantity $Q$};
    \draw[->,very thick] (0,0)--(0,2.2) node[above] {price $p$};
    \draw[red,very thick,domain=0:1.8,samples=70]
      plot (\x,{.1+1.7*\x^2/3.24});
    \draw[blue,very thick,domain=0:1.8,samples=70]
      plot (\x,{.5+1.5*(1.8-\x)^2/3.24});
    \draw[densely dotted] (0,\peq) node[left] {$MCP$}
      --(\qeq,\peq)--(\qeq,0) node[below] {$MCV$};
    \fill (\qeq,\peq) circle (1.3pt);
    \node[blue] at (.25,1.34) {CS};
    \node[red] at (.27,.39) {PS};
    \node[red,anchor=west,font=\footnotesize] at (1.85,1.8) {inverse supply $p(Q_S)$};
    \node[blue,anchor=west,font=\footnotesize] at (1.85,.5) {inverse demand $p(Q_D)$};
  \end{tikzpicture}
\end{frame}


\begin{frame}
  \frametitle{Consumer and producer surpluses: example}

  Consider the previous example:

  Aggregated inverse demand curve $p_D(Q_D) = 28 - 4Q_D$.

  Aggregated inverse supply curve $p_S(Q_S) = 1 + 5Q_S$.

  MCV and MCP are $Q^*=3, p^* = 16$.


  Q: What are the consumer and producer surpluses?

  Consumer surplus: $CS = 0.5*3*(28-16) = 18$.

  Producer surplus: $PS = 0.5*3*(16-1) = 22.5$.

  Total welfare: $TW = CS + PS = 18 + 22.5 = 40.5$.
\end{frame}



\begin{frame}
  \frametitle{Market failures}

  Markets can fail to deliver welfare-maximisation if the conditions for perfect competition are not met. This can justify \alert{state intervention}.
  Examples of \alert{market failures} include:
  \begin{itemize}
  \item \alert{Monopoly/monopsony}: Single actors dominate and use \alert{market power} to set prices
  \item \alert{Asymmetric information}: Some actors have more information than others (e.g. insider trading, used car salesman deliberately selling faulty goods)
  \item \alert{Inhomogeneous goods}: Quality differences (e.g. fake Gucci handbags)
  \item \alert{Market entry/exit barriers}: Examples include taxi cartels, notaries
  \item \alert{Externalities ignored}: Costs are induced on third parties not active in the market, which are not priced in (e.g. air pollution, greenhouse gases)
  \item \alert{Public goods}: Everyone benefits from them, but nobody has an incentive to produce them - \alert{free-rider problem} (e.g. peace, biodiversity, dikes, education)
  \end{itemize}
\end{frame}



\begin{frame}
  \frametitle{Reaction to state regulation: minimum price}

 A \alert{minimum price} or \alert{floor price} can lead to lower demand and/or excess supply (if there is a buyer of last resort like the state). Cf. butter
 mountains and milk lakes in EU in past; minimum wages.


  \centering
\begin{tikzpicture}[
    scale=2,
    demand/.style={blue, thick},
    supply/.style={red, thick},
    axis/.style={very thick, ->, >=stealth', line join=miter},
    important line/.style={thick}, dashed line/.style={dashed, thin},
    every node/.style={color=black},
    dot/.style={circle,fill=black,minimum size=4pt,inner sep=0pt,
      outer sep=-1pt},
  ]
  % axis
  \draw[axis,<->] (2.5,0) node(xline)[right] {quantity $Q$} -|
  (0,2.5) node(yline)[above] {price $p$};
  % demand-supply diagram
  \draw[supply] (0,0.1) coordinate (supply_1) parabola (1.8,1.8)
  coordinate (supply_2) node[above] {inverse supply $p(Q_S)$};
  \draw[demand] (0,2) coordinate (demand_1) parabola[bend at end]
           (1.8,.5) coordinate (demand_2) node[right] {inverse demand $p(Q_D)$};
  \draw[dashed line]
  (0,0.75) node[left]{$p_0$} -- (1.1,0.75) node[dot]{} -- (1.1,0) node[below]{$Q_0$};
  \draw[dashed line]
  (0,1.3) node[left]{$p_{\min}$} -- (0.5,1.3) node[dot]{} -- (0.5,0) node[below]{$Q_{\textrm{demand}}$};
  \draw[dashed line]
  (0,1.3) node[left]{} -- (1.5,1.3) node[dot]{} -- (1.5,0) node[below]{$Q_{\textrm{supply}}$};

\end{tikzpicture}
\end{frame}






\begin{frame}
  \frametitle{Minimum price: effect on total welfare}

  The introduction of a minimum price will \alert{reduce} total welfare in this market, although it may have benefits in other parts of society (e.g. economic security for farmers and a living wage for workers). The \alert{welfare loss (WL)} or \alert{deadweight loss} corresponds to the orange triangle.


  \centering
\begin{tikzpicture}[
    scale=2,
    demand/.style={blue, thick},
    supply/.style={red, thick},
    axis/.style={very thick, ->, >=stealth', line join=miter},
    important line/.style={thick}, dashed line/.style={dashed, thin},
    every node/.style={color=black},
    dot/.style={circle,fill=black,minimum size=4pt,inner sep=0pt,
      outer sep=-1pt},
  ]
  % axis
  \draw[axis,<->] (2.5,0) node(xline)[right] {quantity $Q$} -|
  (0,2.5) node(yline)[above] {price $p$};
  % demand-supply diagram
  \draw[supply] (0,0.1) coordinate (supply_1) parabola (1.8,1.8)
  coordinate (supply_2) node[above] {inverse supply $p(Q_S)$};
  \draw[demand] (0,2) coordinate (demand_1) parabola[bend at end]
           (1.8,.5) coordinate (demand_2) node[right] {inverse demand $p(Q_D)$};
  \draw[dashed line]
  (0,0.75) node[left]{$p_0$} -- (1.1,0.75) node[dot]{} -- (1.1,0) node[below]{$Q_0$};
  \draw[dashed line]
  (0,1.3) node[left]{$p_{\min}$} -- (0.5,1.3) node[dot]{} -- (0.5,0) node[below]{$Q_{\textrm{demand}}$};
  \draw[dashed line]
  (0,1.3) node[left]{} -- (1.5,1.3) node[dot]{} -- (1.5,0) node[below]{$Q_{\textrm{supply}}$};


  \draw[fill=red, fill opacity=0.3]
  (0,0.1) parabola (0.5,0.23) -- (0.5,1.3) -- (0,1.3);

  \draw[fill=blue, fill opacity=0.3]
  (0,2) parabola bend (1.8,0.5) (0.5,1.3) -- (0,1.3);

  \draw[fill=orange, fill opacity=0.3]
  (0.5,0.23) parabola bend (0,0.1) (1.1,0.73) parabola bend (1.8,0.5) (0.5,1.3);

  % for parabola bends https://tikz.dev/tikz-paths#sec-14.9

    \node[blue,right] at (0.02,1.5) {CS};
    \node[red,right] at (0.02,0.7) {PS};
    \node[orange,right] at (0.55,0.7) {WL};

\end{tikzpicture}
\end{frame}


\begin{frame}
  \frametitle{Reaction to state regulation: maximum price}

 A \alert{maximum price} or \alert{price cap} can lead to lower supply and/or excess demand. Cf. rent caps, energy price caps.


  \centering
\begin{tikzpicture}[
    scale=2,
    demand/.style={blue, thick},
    supply/.style={red, thick},
    axis/.style={very thick, ->, >=stealth', line join=miter},
    important line/.style={thick}, dashed line/.style={dashed, thin},
    every node/.style={color=black},
    dot/.style={circle,fill=black,minimum size=4pt,inner sep=0pt,
      outer sep=-1pt},
  ]
  % axis
  \draw[axis,<->] (2.5,0) node(xline)[right] {quantity $Q$} -|
  (0,2.5) node(yline)[above] {price $p$};
  % demand-supply diagram
  \draw[supply] (0,0.1) coordinate (supply_1) parabola (1.8,1.8)
  coordinate (supply_2) node[above] {inverse supply $p(Q_S)$};
  \draw[demand] (0,2) coordinate (demand_1) parabola[bend at end]
           (1.8,.5) coordinate (demand_2) node[right] {inverse demand $p(Q_D)$};
  \draw[dashed line]
  (0,0.75) node[left]{$p_0$} -- (1.1,0.75) node[dot]{} -- (1.1,0) node[below]{$Q_0$};
  \draw[dashed line]
  (0,0.5) node[left]{$p_{\max}$} -- (0.85,0.5) node[dot]{} -- (0.85,0) node[below]{$Q_{\textrm{supply}}$};
  \draw[dashed line]
  (0,0.5) node[left]{} -- (1.8,0.5) node[dot]{} -- (1.8,0) node[below]{$Q_{\textrm{demand}}$};

\end{tikzpicture}
\end{frame}



\begin{frame}
  \frametitle{Maximum price: effect on total welfare}

  The introduction of a maximum price will \alert{reduce} total welfare in this market, although it may have benefits in other parts of society (e.g. benefits for consumers). The \alert{welfare loss (WL)} or \alert{deadweight loss} corresponds to the orange triangle.


  \centering
\begin{tikzpicture}[
    scale=2,
    demand/.style={blue, thick},
    supply/.style={red, thick},
    axis/.style={very thick, ->, >=stealth', line join=miter},
    important line/.style={thick}, dashed line/.style={dashed, thin},
    every node/.style={color=black},
    dot/.style={circle,fill=black,minimum size=4pt,inner sep=0pt,
      outer sep=-1pt},
  ]
  % axis
  \draw[axis,<->] (2.5,0) node(xline)[right] {quantity $Q$} -|
  (0,2.5) node(yline)[above] {price $p$};
  % demand-supply diagram
  \draw[supply] (0,0.1) coordinate (supply_1) parabola (1.8,1.8)
  coordinate (supply_2) node[above] {inverse supply $p(Q_S)$};
  \draw[demand] (0,2) coordinate (demand_1) parabola[bend at end]
           (1.8,.5) coordinate (demand_2) node[right] {inverse demand $p(Q_D)$};
  \draw[dashed line]
  (0,0.75) node[left]{$p_0$} -- (1.1,0.75) node[dot]{} -- (1.1,0) node[below]{$Q_0$};
  \draw[dashed line]
  (0,0.5) node[left]{$p_{\max}$} -- (0.85,0.5) node[dot]{} -- (0.85,0) node[below]{$Q_{\textrm{supply}}$};
  \draw[dashed line]
  (0,0.5) node[left]{} -- (1.8,0.5) node[dot]{} -- (1.8,0) node[below]{$Q_{\textrm{demand}}$};


  \draw[fill=red, fill opacity=0.3]
  (0,0.1) parabola (0.85,0.5) -- (0,0.5);

  \draw[fill=blue, fill opacity=0.3]
  (0,2) parabola bend (1.8,0.5) (0.85,0.92) -- (0.85,0.5) -- (0,0.5);

  \draw[fill=orange, fill opacity=0.3]
  (0.85,0.5) parabola bend (0,0.1) (1.1,0.75) parabola bend (1.8,0.5) (0.85,0.92);

  % for parabola bends https://tikz.dev/tikz-paths#sec-14.9

    \node[blue,right] at (0.02,1.1) {CS};
    \node[red,right] at (0.02,0.3) {PS};
    \node[orange,right] at (0.81,0.65) {WL};



\end{tikzpicture}
\end{frame}



\begin{frame}
  \frametitle{Consumer and producer surpluses: response to tax}

  A \alert{tax} leads to \alert{tax revenue} for the state, which counts towards the total welfare. However there is a \alert{welfare loss} or \alert{deadweight loss} compared to the case without the tax.


  \centering
\begin{tikzpicture}[
    scale=1.8,
    demand/.style={blue, thick},
    supply/.style={red, thick},
    axis/.style={very thick, ->, >=stealth', line join=miter},
    important line/.style={thick}, dashed line/.style={dashed, thin},
    every node/.style={color=black},
    dot/.style={circle,fill=black,minimum size=4pt,inner sep=0pt,
      outer sep=-1pt},
  ]
  % axis
  \draw[axis,<->] (2.5,0) node(xline)[right] {quantity $Q$} -|
  (0,2.5) node(yline)[above] {price $p$};
  % demand-supply diagram
  \draw[supply] (0,0.1) coordinate (supply_1) -- (2,2.1)
  coordinate (supply_2) node[right] {supply $p(Q_S)$};
  \draw[supply] (0,0.6) coordinate (supply_1) -- (2,2.6)
  coordinate (supply_2) node[above] {supply with tax $p_{\textrm{tax}}(Q_S)$};
  \draw[demand] (0,2.3) coordinate (demand_1) --
           (2,0.3) coordinate (demand_2) node[right] {inverse demand $p(Q_D)$};
  \draw[dashed line]
  (0,1.2) node[left]{$p$} -- (1.1,1.2) node[dot]{} -- (1.1,0) node[below]{$Q$};
  \draw[dashed line]
  (0,1.45) node[left]{$p_{\textrm{tax}}$} -- (0.85,1.45) node[dot]{} -- (0.85,0) node[below]{$Q_{\textrm{tax}}$};

  \draw[fill=red, fill opacity=0.3]
  (0,0.6) -- (0.85,1.45) -- (0,1.45);

  \draw[fill=blue, fill opacity=0.3]
  (0,2.3) -- (0.85,1.45) -- (0,1.45);

  \draw[fill=green, fill opacity=0.2]
  (0,0.6) -- (0.85,1.45) -- (0.85,0.95) -- (0,0.1);

  \draw[fill=orange, fill opacity=0.5]
  (0.85,1.45) -- (0.85,0.95) -- (1.1,1.2);

  \draw[decorate,decoration={brace},thick] (-0.1,0.1) -- (-0.1,0.6);
  \node[left] at (-0.12,0.35) {tax rate};

    \node[blue,right] at (0,1.7) {CS};
    \node[red,right] at (0,1.1) {PS};
    \node[green,right] at (0.3,0.8) {tax};
    \node[orange,right] at (1.1,1.2) {deadweight loss};


  %\fill[red] (0,1) -- (1,1) -- (0,0);
\end{tikzpicture}


\end{frame}

\begin{frame}
  \frametitle{Market clearing price and volume with tax: simple example}

  Consider a market with:

  Aggregated inverse demand curve $p_D(Q_D) = 28 - 4Q_D$.

  Aggregated inverse supply curve $p_S(Q_S) = 1 + 5Q_S$.

  Suppose we tax the product at a rate of 9\euro/unit.  What is the market clearing price and volume now?

  Solve
  \begin{equation*}
    28 - 4Q = 10 + 5Q
  \end{equation*}
  Find $Q^*=2, p^* = 20$.


\end{frame}



\begin{frame}
  \frametitle{Market clearing price and volume with tax: simple example}

  Consider a market with:

  Aggregated inverse demand curve $p_D(Q_D) = 28 - 4Q_D$.

  Aggregated inverse supply curve $p_S(Q_S) = 1 + 5Q_S$.

  Suppose we tax the product at a rate of 9\euro/unit.  How do the surpluses change?


  Consumer surplus: $CS_{\textrm{tax}} = 0.5*2*(28-20) = 8$.

  Producer surplus: $PS_{\textrm{tax}} = 0.5*2*(20-10) = 10$.

  Total tax revenue: $TR_{\textrm{tax}} = 2*9 = 18$.

  Total welfare includes tax revenue: $TW_{\textrm{tax}} = CS + PS + TR = 36$.

  Deadweight loss: $TW - TW_{\textrm{tax}} = 40.5 - 18 - 18 = 4.5$.

\end{frame}




\begin{frame}
  \frametitle{Consumer and producer surpluses: response to a subsidy}

  A \alert{subsidy} leads to \alert{tax burden} for the state (subsidy $\times\, Q_{\textrm{subsidy}}$), which subtracts from the total welfare. There is still a \alert{welfare loss} compared to the case without the subsidy.


  \centering
\begin{tikzpicture}[
    scale=1.8,
    demand/.style={blue, thick},
    supply/.style={red, thick},
    axis/.style={very thick, ->, >=stealth', line join=miter},
    important line/.style={thick}, dashed line/.style={dashed, thin},
    every node/.style={color=black},
    dot/.style={circle,fill=black,minimum size=4pt,inner sep=0pt,
      outer sep=-1pt},
  ]
  % axis
  \draw[axis,<->] (2.5,0) node(xline)[right] {quantity $Q$} -|
  (0,2.5) node(yline)[above] {price $p$};
  % demand-supply diagram
  \draw[supply] (0,0.4) coordinate (supply_1) -- (2,2.4)
  coordinate (supply_2) node[right] {$p(Q_S)$};
  \draw[supply] (0,0.1) coordinate (supply_1) -- (2,2.1)
  coordinate (supply_2) node[right] {$p_{\textrm{subsidy}}(Q_S)$};
  \draw[demand] (0,2.3) coordinate (demand_1) --
           (2,0.3) coordinate (demand_2) node[right] {inverse demand $p(Q_D)$};
  \draw[dashed line]
  (0,1.35) node[left]{$p$} -- (0.95,1.35) node[dot]{} -- (0.95,0) node[below]{$Q$};
  \draw[dashed line]
  (0,1.2) node[left]{$p_{\textrm{subsidy}}$} -- (1.1,1.2) node[dot]{} -- (1.1,-0.2) node[right]{$Q_{\textrm{subsidy}}$};

  \draw[fill=red, fill opacity=0.3]
  (0,0.1) -- (1.1,1.2) -- (0,1.2);

  \draw[fill=blue, fill opacity=0.3]
  (0,2.3) -- (1.1,1.2) -- (0,1.2);

  \draw[fill=green, fill opacity=0.2]
  (0,0.1) -- (1.1,1.2) -- (1.1,1.5) -- (0,0.4);

  \draw[fill=orange, fill opacity=0.5]
  (1.1,1.2) -- (0.95,1.35) -- (1.1,1.5);

  \draw[decorate,decoration={brace},thick] (-0.1,0.1) -- (-0.1,0.4);
  \node[left] at (-0.12,0.25) {subsidy};

    \node[blue,right] at (0,1.7) {CS};
    \node[red,right] at (0,0.9) {PS};
    \node[green,right] at (0.3,0.8) {subsidy};
    \node[orange,right] at (1.1,1.4) {welfare loss};


  %\fill[red] (0,1) -- (1,1) -- (0,0);
\end{tikzpicture}


\end{frame}




\begin{frame}
  \frametitle{Trade}

  Trade between 2 regions always leads to a \alert{welfare gain} (WG) in each country, but can have a strong influence on the distribution between the consumer and producer surpluses.

  \centering
\begin{tikzpicture}[
    scale=1.7,
    demand/.style={blue, thick},
    supply/.style={red, thick},
    axis/.style={very thick, ->, >=stealth', line join=miter},
    important line/.style={thick}, dashed line/.style={dashed, thin},
    every node/.style={color=black},
    dot/.style={circle,fill=black,minimum size=4pt,inner sep=0pt,
      outer sep=-1pt},
  ]
  % axis
  \draw[axis,<->] (2.5,0) node(xline)[right] {quantity $Q$} -|
  (0,2.5) node(yline)[above] {price $p$};
  % demand-supply diagram
  \draw[supply] (0,0.1) coordinate (supply_1) -- (2,2.1)
  coordinate (supply_2) node[right] {};
  \draw[demand] (0,2.3) coordinate (demand_1) --
           (2,0.3) coordinate (demand_2) node[right] {};
  \draw[dashed line]
  (0.6,1.7) node[dot]{} -- (0.6,0) node[below]{$Q_D$};
  \draw[dashed line]
  (1.6,1.7) node[dot]{} -- (1.6,0) node[below]{$Q_S$};
  \draw[dashed line]
  (0,1.7) node[left]{$p_{\textrm{world},1}$}  -- (2.3,1.7);

  \draw[fill=red, fill opacity=0.3]
  (0,0.1) -- (1.6,1.7) -- (0,1.7);

  \draw[fill=blue, fill opacity=0.3]
  (0,2.3) -- (0.6,1.7) -- (0,1.7);

  \draw[pattern=north west lines, pattern color=brown] (1.1,1.2) -- (0.6,1.7) -- (1.6,1.7);

  \draw[decorate,decoration={brace},thick] (0.6,1.75) -- (1.6,1.75);
  \node[above] at (1.1,1.85) {export};

    \node[blue,right] at (0,1.85) {CS};
    \node[red,right] at (0,1.3) {PS};

    \node[brown,above] at (1.1,1.4) {WG};

  %\fill[red] (0,1) -- (1,1) -- (0,0);


  \begin{scope}[xshift=4cm]

  % axis
  \draw[axis,<->] (2.5,0) node(xline)[right] {quantity $Q$} -|
  (0,2.5) node(yline)[above] {price $p$};
  % demand-supply diagram
  \draw[supply] (0,0.1) coordinate (supply_1) -- (2,2.1)
  coordinate (supply_2) node[right] {};
  \draw[demand] (0,2.3) coordinate (demand_1) --
           (2,0.3) coordinate (demand_2) node[right] {};
  \draw[dashed line]
  (0.6,0.7) node[dot]{} -- (0.6,0) node[below]{$Q_S$};
  \draw[dashed line]
  (1.6,0.7) node[dot]{} -- (1.6,0) node[below]{$Q_D$};
  \draw[dashed line]
  (0,0.7) node[left]{$p_{\textrm{world},2}$}  -- (2.3,0.7);

  \draw[fill=red, fill opacity=0.3]
  (0,0.1) -- (0.6,0.7) -- (0,0.7);

  \draw[fill=blue, fill opacity=0.3]
  (0,2.3) -- (1.6,0.7) -- (0,0.7);

  \draw[pattern=north west lines, pattern color=brown] (1.6,0.7) -- (0.6,0.7) -- (1.1,1.2);

  \draw[decorate,decoration={brace},thick] (1.6,0.65) -- (0.6,0.65);
  \node[below] at (1.1,0.65) {import};

    \node[blue,right] at (0,1.3) {CS};
    \node[red,right] at (0,0.5) {PS};

    \node[brown,above] at (1.1,0.75) {WG};

  %\fill[red] (0,1) -- (1,1) -- (0,0);

  \end{scope}
\end{tikzpicture}


\end{frame}

\section{Elasticity}


\begin{frame}
  \frametitle{Price elasticity}

  \alert{Elasticity} is a is a measure of how much buyers and sellers respond to  changes in market conditions.


  \alert{Price elasticity} measures the response to price changes.
  Price elasticity of demand $\eta_{p,Q}$ is a measure of how much the
  quantity consumed of a good responds to a change in the price of
  that good.

  \begin{equation*}
    \textrm{Price elasticity of demand} = \frac{\%  \textrm{ change in quantity consumed}}{\%  \textrm{ change in price}}
  \end{equation*}

  \begin{equation*}
     \eta_{p,Q}= \frac{\frac{dQ}{Q}}{\frac{dp}{p}} = \frac{dQ}{dp} \cdot \frac{p}{Q}
  \end{equation*}

\end{frame}

\begin{frame}
  \frametitle{Elastic versus inelastic demand}

  Demand-price elasticity is generally negative: the higher the price,
  the lower the demand. The magnitude of the elasticity allows it to
  be classified:


    \ra{1.1}
  \begin{table}[!t]
    \begin{tabular}{rl}%{p{4cm}p{7cm}}
      $-\infty < \eta_{p,Q} \leq  -1$ & \alert{elastic demand} (big change in demand for small change in price)\\
      $\eta_{p,Q} = -1$ & \alert{isoelastic demand} (same \% change in demand for \% change in price)\\
      $-1 < \eta_{p,Q} \leq 0$ & \alert{inelastic demand} (small change in demand for large change in price)\\
    \end{tabular}
  \end{table}


  If demand does not respond at all to prices, $\eta_{p,Q} = 0$, it is \alert{perfectly inelastic}.

\end{frame}




\begin{frame}
  \frametitle{Arc elasticity}

  The \alert{arc elasticity} can be measured if you know how the demand responds to  a specific price increase from $p_0$ to $p_1$.

  \centering
\begin{tikzpicture}[
    scale=1.8,
    demand/.style={blue, thick},
    supply/.style={red, thick},
    axis/.style={very thick, ->, >=stealth', line join=miter},
    important line/.style={thick}, dashed line/.style={dashed, thin},
    every node/.style={color=black},
    dot/.style={circle,fill=black,minimum size=4pt,inner sep=0pt,
      outer sep=-1pt},
  ]
  % axis
  \draw[axis,<->] (2.5,0) node(xline)[right] {quantity $Q$} -|
  (0,2.5) node(yline)[above] {price $p$};
  % demand-supply diagram
  \draw[demand] (0.1,1.95) coordinate (demand_1) --
           (2,1) coordinate (demand_2) node[right] {};
  \draw[dashed line]
  (0,1.6) node[left]{$p_1$} -- (0.8,1.6) node[dot]{} -- (0.8,0) node[below]{$Q_1$};
  \draw[dashed line]
  (0,1.2) node[left]{$p_0$} -- (1.6,1.2) node[dot]{} -- (1.6,0) node[below]{$Q_0$};

  \draw[->, very thick, black, >=stealth']
  (0.3,1.25) -- (0.3,1.55);

  \draw[->, very thick, black, >=stealth']
  (1.55,0.7) -- (0.85,0.7);

  \node at (2,2) {$\eta_{p,Q}= \frac{\frac{\Delta Q}{Q}}{\frac{\Delta p}{p}} = \frac{\frac{Q_1 - Q_0}{Q_0}}{\frac{p_1 - p_0}{p_0}}$};

\end{tikzpicture}


\end{frame}



\begin{frame}
  \frametitle{Point elasticity}

  The \alert{point elasticity} is the infinitesimal version if you can precisely calculate the derivative.

  \centering
\begin{tikzpicture}[
    scale=1.8,
    demand/.style={blue, thick},
    supply/.style={red, thick},
    axis/.style={very thick, ->, >=stealth', line join=miter},
    important line/.style={thick}, dashed line/.style={dashed, thin},
    every node/.style={color=black},
    dot/.style={circle,fill=black,minimum size=4pt,inner sep=0pt,
      outer sep=-1pt},
  ]
  % axis
  \draw[axis,<->] (2.5,0) node(xline)[right] {quantity $Q$} -|
  (0,2.5) node(yline)[above] {price $p$};
  % demand-supply diagram
  \draw[demand] (0.1,1.95) coordinate (demand_1) --
           (2,1) coordinate (demand_2) node[right] {};
  \draw[dashed line]
  (0,1.6) node[left]{$p_1$} -- (0.8,1.6) node[dot]{} -- (0.8,0) node[below]{$Q_1$};
  \draw[dashed line]
  (0,1.4) node[left]{$p$} -- (1.2,1.4) node[dot]{} -- (1.2,0) node[below]{$Q$};
  \draw[dashed line]
  (0,1.2) node[left]{$p_0$} -- (1.6,1.2) node[dot]{} -- (1.6,0) node[below]{$Q_0$};

  \draw[->, very thick, black, >=stealth']
  (0.3,1.25) -- (0.3,1.55);

  \draw[->, very thick, black, >=stealth']
  (1.55,0.7) -- (0.85,0.7);

  \node at (2,2) {$\eta_{p,Q}= \frac{\frac{dQ}{Q}}{\frac{dp}{p}} = \frac{dQ}{dp} \cdot \frac{p}{Q}$};

\end{tikzpicture}


\end{frame}




\begin{frame}
  \frametitle{Examples of price-demand elasticity}

  Consider the following arc elasticities:

  \centering
\begin{tikzpicture}[
    scale=1,
    font=\tiny,
    demand/.style={blue, thick},
    supply/.style={red, thick},
    axis/.style={very thick, ->, >=stealth', line join=miter},
    important line/.style={thick}, dashed line/.style={dashed, thin},
    every node/.style={color=black},
    dot/.style={circle,fill=black,minimum size=4pt,inner sep=0pt,
      outer sep=-1pt},
  ]

  \begin{scope}[xshift=0cm]

  % axis
  \draw[axis,<->] (2.5,0) node(xline)[right] {$Q$} -|
  (0,2.5) node(yline)[above] {$p$};
  % demand-supply diagram
  \draw[demand] (0.1,1.975) coordinate (demand_1) --
           (2,1.5) coordinate (demand_2) node[right] {};
  \draw[dashed line]
  (0,1.8) node[left]{5.05 \euro} -- (0.8,1.8) node[dot]{} -- (0.8,0) node[below]{90};
  \draw[dashed line]
  (0,1.6) node[left]{5.00 \euro} -- (1.6,1.6) node[dot]{} -- (1.6,0) node[below]{100};

  \node at (2,2.2) {$\eta_{p,Q}= \frac{\frac{90-100}{100}}{\frac{5.05-5}{5}} = \frac{-0.1}{0.01} = -10$};

  \node[below right,font=\small,text width=3.5cm] at (0,-0.5) {\alert{very elastic} (small change in price $\Rightarrow$ big change in demand)};


  \end{scope}


    \begin{scope}[xshift=5cm]

  % axis
  \draw[axis,<->] (2.5,0) node(xline)[right] {$Q$} -|
  (0,2.5) node(yline)[above] {$p$};
  % demand-supply diagram
  \draw[demand] (0.1,1.9) coordinate (demand_1) --
           (1.8,0.2) coordinate (demand_2) node[right] {};
  \draw[dashed line]
  (0,1.2) node[left]{5.50 \euro} -- (0.8,1.2) node[dot]{} -- (0.8,0) node[below]{90};
  \draw[dashed line]
  (0,0.4) node[left]{5.00 \euro} -- (1.6,0.4) node[dot]{} -- (1.6,0) node[below]{100};

  \node at (2,2) {$\eta_{p,Q}=\frac{-0.1}{0.1} = -1$};

  \node[below right,font=\small,text width=3.5cm] at (0,-0.5) {\alert{isoelastic} (change in price $\Rightarrow$ propotional change in demand)};

  \end{scope}

    \begin{scope}[xshift=9cm]

  % axis
  \draw[axis,<->] (2.5,0) node(xline)[right] {$Q$} -|
  (0,2.5) node(yline)[above] {$p$};
  % demand-supply diagram
  \draw[demand] (1,2) coordinate (demand_1) --
           (1.9,0.2) coordinate (demand_2) node[right] {};
  \draw[dashed line]
  (0,1.6) node[left]{5.50 \euro} -- (1.2,1.6) node[dot]{} -- (1.2,0) node[below]{99};
  \draw[dashed line]
  (0,0.8) node[left]{5.00 \euro} -- (1.6,0.8) node[dot]{} -- (1.6,0) node[below]{100};

  \node at (2.4,2) {$\eta_{p,Q}=\frac{-0.01}{0.1} = -0.1$};

  \node[below right,font=\small,text width=3.5cm] at (0,-0.5) {\alert{very inelastic} (large change in price $\Rightarrow$ small change in demand)};
  \end{scope}

\end{tikzpicture}


\end{frame}





\begin{frame}
  \frametitle{Maximising revenue}

  Suppose a supplier has the market power to manipulate the price, and they have no marginal costs. How to maximise the \alert{revenue} $R(p) = p\cdot Q(p)$? Consider effect of price increase:

  \centering
\begin{tikzpicture}[
    scale=1,
    font=\tiny,
    demand/.style={blue, thick},
    supply/.style={red, thick},
    axis/.style={very thick, ->, >=stealth', line join=miter},
    important line/.style={thick}, dashed line/.style={dashed, thin},
    every node/.style={color=black},
    dot/.style={circle,fill=black,minimum size=4pt,inner sep=0pt,
      outer sep=-1pt},
  ]

  \begin{scope}[xshift=0cm]

  % axis
  \draw[axis,<->] (2.5,0) node(xline)[right] {$Q$} -|
  (0,2.5) node(yline)[above] {$p$};
  % demand-supply diagram
  \draw[demand] (0.1,1.975) coordinate (demand_1) --
           (2,1.5) coordinate (demand_2) node[right] {};
  \draw[dashed line]
  (0,1.8) node[left]{5.05 \euro} -- (0.8,1.8) node[dot]{} -- (0.8,0) node[below]{90};
  \draw[dashed line]
  (0,1.6) node[left]{5.00 \euro} -- (1.6,1.6) node[dot]{} -- (1.6,0) node[below]{100};

  \node at (2,2.2) {$\eta_{p,Q}= \frac{\frac{90-100}{100}}{\frac{5.05-5}{5}} = \frac{-0.1}{0.01} = -10$};

  \node[below right,font=\small,text width=3.5cm] at (0,-0.5) {\alert{elastic}\\ $R(p) = 5\cdot 100 = 500$ $\to 5.05\cdot 90 = 454.50$ \\ $\Rightarrow$ better to drop the price};


  \end{scope}


    \begin{scope}[xshift=5cm]

  % axis
  \draw[axis,<->] (2.5,0) node(xline)[right] {$Q$} -|
  (0,2.5) node(yline)[above] {$p$};
  % demand-supply diagram
  \draw[demand] (0.1,1.9) coordinate (demand_1) --
           (1.8,0.2) coordinate (demand_2) node[right] {};
  \draw[dashed line]
  (0,1.2) node[left]{5.50 \euro} -- (0.8,1.2) node[dot]{} -- (0.8,0) node[below]{90};
  \draw[dashed line]
  (0,0.4) node[left]{5.00 \euro} -- (1.6,0.4) node[dot]{} -- (1.6,0) node[below]{100};

  \node at (2,2) {$\eta_{p,Q}=\frac{-0.1}{0.1} = -1$};

  \node[below right,font=\small,text width=3.5cm] at (0,-0.5) {\alert{isoelastic}\\ $R(p) = 5\cdot 100 = 500$ $\to 5.5\cdot 90 = 495$ \\ $\Rightarrow$ leave price the same};

  \end{scope}

    \begin{scope}[xshift=9cm]

  % axis
  \draw[axis,<->] (2.5,0) node(xline)[right] {$Q$} -|
  (0,2.5) node(yline)[above] {$p$};
  % demand-supply diagram
  \draw[demand] (1,2) coordinate (demand_1) --
           (1.9,0.2) coordinate (demand_2) node[right] {};
  \draw[dashed line]
  (0,1.6) node[left]{5.50 \euro} -- (1.2,1.6) node[dot]{} -- (1.2,0) node[below]{99};
  \draw[dashed line]
  (0,0.8) node[left]{5.00 \euro} -- (1.6,0.8) node[dot]{} -- (1.6,0) node[below]{100};

  \node at (2.4,2) {$\eta_{p,Q}=\frac{-0.01}{0.1} = -0.1$};

  \node[below right,font=\small,text width=3.5cm] at (0,-0.5) {\alert{inelastic}\\ $R(p) = 5\cdot 100 = 500$ $\to 5.5\cdot 99 = 544.50$ \\ $\Rightarrow$ raise the price};
  \end{scope}

\end{tikzpicture}

\end{frame}


\begin{frame}
  \frametitle{Maximising revenue}

  Suppose a supplier has the market power to manipulate the price, and they have no marginal costs. How would they maximise the \alert{revenue} $R(p) = p\cdot Q(p)$?

  We can also demonstrate this mathematically by maximising $R(p)$:
  \begin{equation*}
    0 = \frac{dR}{dp} = \frac{d(p\cdot Q(p))}{dp} = p\cdot \frac{dQ(p)}{dp} + Q(p) = Q\left( \frac{p}{Q}\frac{dQ(p)}{dp}  + 1 \right) = Q (\eta_{p,Q} + 1)
  \end{equation*}

  So the revenue is maximised when we reach the isoelastic point $\eta_{p,Q}  = -1$.

\end{frame}


\begin{frame}
  \frametitle{Electricity demand: typically inelastic}

  Demand for electricity is largely inelastic.

  General reasons for inelasticity:
  \begin{itemize}
  \item Consumers do not perceive the price changes (hidden in monthly bills)
  \item Lack of substitutes (e.g. for heating: gas, for lighting: gas lamps, for communication: pigeon?, for computation: abacus?)
   \item Switching to alternative products (substitutes) is cumbersome
  \end{itemize}

  Distinguish between \alert{short-run elasticity} and \alert{long-run elasticity}. Long-run elasticity allows consumers time (e.g. years) to become more aware of and purchase alternatives. In the long-run demand tends to be more elastic than the short-run.

  E.g. if petrol prices remain high over many years, consumers may be more likely to switch to electric vehicles.
\end{frame}

\begin{frame}
  \frametitle{Short-run versus long-run price elasticity}
  \small
  Demand responds more strongly when consumers have more time to adjust to a
  sustained price change.

  \textbf{Example: road fuel demand}

  \begin{center}
    \renewcommand{\arraystretch}{1.25}
    \begin{tabular}{@{}lcc@{}}
      \toprule
      & Short run & Long run \\
      & Usually within 1 year & Adjustment over roughly 5--10 years \\
      \midrule
      Price elasticity $\eta$ & $-0.25$ & $-0.64$ \\
      Quantity response to a $10\%$ price rise & approx. $-2.5\%$ & approx. $-6.4\%$ \\
      \bottomrule
    \end{tabular}
  \end{center}

  \alert{Short run}: drive less or drive more efficiently.

  \alert{Long run as well}: switch to more fuel-efficient vehicles.

  \footnotesize Literature-review averages; the time horizons are approximate.
  \source{\hrefc{https://doi.org/10.1080/0144164042000181725}{Goodwin et al. (2004)}, Table\,3}
\end{frame}


\begin{frame}
  \frametitle{Beware: slope is not the same as elasticity}

  The slope of the inverse demand curve is \alert{not the same} as the elasticity.

  \begin{columns}[T]
  \begin{column}{9cm}
  \centering
\begin{tikzpicture}[
    scale=1.8,
    demand/.style={blue, thick},
    supply/.style={red, thick},
    axis/.style={very thick, ->, >=stealth', line join=miter},
    important line/.style={thick}, dashed line/.style={dashed, thin},
    every node/.style={color=black},
    dot/.style={circle,fill=black,minimum size=4pt,inner sep=0pt,
      outer sep=-1pt},
  ]
  % axis
  \draw[axis,<->] (2.5,0) node(xline)[right] {quantity $Q$} -|
  (0,2.5) node(yline)[above] {price $p$};
  % demand-supply diagram
  \draw[demand] (0,2) coordinate (demand_1) --
           (2,0) coordinate (demand_2) node[right] {};
  \draw[dashed line]
  (1,1)  node{} -- (1,0) node[below]{$\frac{a}{2b}$};
  \node[below] at (2,0) {$\frac{a}{b}$};

  \node[dot] at (0,2) {};
  \node[dot] at (1,1) {};
  \node[dot] at (2,0) {};
  \node[above right] at (0,2) {$\eta_{p,Q}= -\infty$};
  \node[above right] at (1,1) {$\eta_{p,Q}= -1$};
  \node[above right] at (2,0) {$\eta_{p,Q}= 0$};

\end{tikzpicture}

  \end{column}
  \begin{column}{5cm}
    For a linear inverse demand function:
    \begin{equation*}
      p(Q) = a - bQ
    \end{equation*}
    for $a,b > 0$ we have the demand function:
    \begin{equation*}
      Q(p) = \frac{a - p}{b}
    \end{equation*}

    The elasticity varies with $Q$:
    \begin{equation*}
      \eta_{p,Q} = \frac{p}{Q}\frac{dQ}{dp} = 1 - \frac{a}{bQ}
    \end{equation*}

    \end{column}
  \end{columns}
\end{frame}

\begin{frame}
  \frametitle{Positive price-demand elasticity}

  For some goods, the price-demand elasticity can become \alert{positive}, i.e. rising prices lead to rising demand.

  \begin{itemize}
  \item \alert{Veblen or Snob effect}: A product becomes more attractive the more expensive it is (e.g. exclusive clubs in London, whisky, cigars, Renoirs).
  \item \alert{Quality effect}: If quality is hard to assess, price is used as a quality indicator (e.g. you want to buy a nice wine for a friend, but don't know enough about it, so choose an expensive one).
  \end{itemize}

\end{frame}

\begin{frame}
  \frametitle{Cross elasticity}

  If the price of one good has an effect on the demand of another good, this indirect elasticity is called a \alert{cross elasticity}. For example, if the price of one good $p_1$ influences the sales of another $Q_2$ then the cross elasticity is given by:
      \begin{equation*}
      \eta_{p_1,Q_2} = \frac{p_1}{Q_2}\frac{dQ_2}{dp_1}
    \end{equation*}

      \begin{itemize}
      \item Example of \alert{negative} cross-price-elasticity: rising petrol prices leave to sinking demand for internal combustion engine (ICE) cars. Petrol and ICE cars are \alert{complementary goods}.
       \item       Example of \alert{positive} cross-price-elasticity: rising butter prices lead to rising demand for margarine. Butter and margarine are \alert{substitute goods}.
      \end{itemize}


\end{frame}


\begin{frame}
  \frametitle{Elasticity: simple example}

  The price for electricity is 0.2\euro/kWh. The demand function of a private household (per month) is given by:
  \begin{equation*}
    Q_D(p) = 625 - 625p
  \end{equation*}
  where the units of $Q_D$ are kWh and of $p$ are \euro/kWh.

  a) How much electricity does the single household consume per month? How much does it pay?

  \begin{equation*}
    Q_D(p=0.2) = 625 - 0.2*625 = 500
  \end{equation*}
  Consumption: 500 kWh.

    \begin{equation*}
      p\cdot Q_D = 0.2*500 = 100
  \end{equation*}
  Pay per month: 100 \euro/m.


\end{frame}



\begin{frame}
  \frametitle{Elasticity: simple example}

  The price for electricity is 0.2\euro/kWh. The demand function of a private household (per month) is given by:
  \begin{equation*}
    Q_D(p) = 625 - 625p
  \end{equation*}
  where the units of $Q_D$ are kWh and of $p$ are \euro/kWh.

  b) What is the price elasticity at this point? Is it elastic or inelastic?

  \begin{align*}
    \eta_{p,Q} & = \frac{dQ}{dp} \cdot \frac{p}{Q} \\
    & = -625 \cdot \frac{0.2}{500} \\
    & = -0.25
  \end{align*}

  The demand is inelastic.

\end{frame}


\begin{frame}
  \frametitle{Elasticity: simple example}

  The price for electricity is 0.2\euro/kWh. The demand function of a private household (per month) is given by:
  \begin{equation*}
    Q_D(p) = 625 - 625p
  \end{equation*}
  where the units of $Q_D$ are kWh and of $p$ are \euro/kWh.

  c) How does the household react if the price doubles? What are the demand and elasticity now?

  \begin{equation*}
    Q_D(p=0.4) = 625 - 0.4*625 = 375
  \end{equation*}


  \begin{align*}
    \eta_{p,Q} & = \frac{dQ}{dp} \cdot \frac{p}{Q} \\
    & = -625 \cdot \frac{0.4}{375} \\
    & = -0.67
  \end{align*}

  The demand is still inelastic, but a little more elastic i.e. a little more price-responsive.

\end{frame}




\begin{frame}
  \frametitle{Elasticity: simple example}

  The price for electricity is 0.2\euro/kWh. The demand function of a private household (per month) is given by:
  \begin{equation*}
    Q_D(p) = 625 - 625p
  \end{equation*}
  where the units of $Q_D$ are kWh and of $p$ are \euro/kWh.

  d) At what price does the demand become isoelastic?

  Solve
  \begin{align*}
    -1 & = \eta_{p,Q} \\
    & = \frac{dQ}{dp} \cdot \frac{p}{Q} \\
    & = -625 \cdot \frac{p}{625-625p}
  \end{align*}
  We find $p = $ 0.5 \euro/kWh and
  \begin{equation*}
    Q_D(p=0.5) = 625 - 0.5*625 = 312.5
  \end{equation*}

\end{frame}




\section{Production decisions in different types of market}


\begin{frame}
  \frametitle{Production decisions are made in the short run}

  \alert{Production} is concerned with \alert{how much we produce},
  $Q$, assuming that the capacities of all our factories, machinery
  and plant are \alert{already determined}.

  This is a \alert{short run} decision that we can make in the short term.

  In the \alert{long run} we can also change the capacities of production - this is the topic of \alert{investment}, which we will cover later.

\end{frame}



\begin{frame}
  \frametitle{Fixed versus variable costs}

  \alert{Fixed costs} are costs incurred regardless of the production level $Q$ (e.g. building rent, equipment depreciation); \alert{variable costs} depend on $Q$ and vanish when $Q = 0$ (e.g. energy, materials).

  \ra{1.1}
  \begin{table}[!t]
    \begin{tabular}{lp{4cm}p{4cm}}
      \toprule
      product & fixed costs & variable costs \\
      \midrule
      book & author's effort & paper, glue \\
      e-book & author's effort & almost zero\\
      coal plant & loan repayment, wages & coal \\
      wind plant & loan repayment, wages & almost zero \\
      gas pipeline & loan repayment, wages & fuel for compressor \\
      LNG ship & loan repayment, wages & energy for liquefaction, fuel for ship \\
      \bottomrule
    \end{tabular}
  \end{table}
\end{frame}

\begin{frame}
  \frametitle{Terms and definitions of cost accounting}

  Consider some production process.
  \begin{itemize}
  \item \alert{Fixed costs} $C_{fix}$ are the share of total costs that do not change when the produced quantity $Q$ is varied, $\frac{dC_{fix}}{dQ} = 0$.
  \item \alert{Variable costs} $C_{var}(Q)$ are the share of total costs that do change when the produced quantity $Q$ is varied.
    \item \alert{Total costs} are the sum of fixed and variable costs, $C(Q) =C_{fix} + C_{var}(Q)$.
    \item \alert{Average costs} are the total costs per unit: $AC(Q) = \frac{C(Q)}{Q}$.
    \item \alert{Marginal costs} are the costs incurred per unit for an additional unit of production; they depend on current production rate $MC(Q) = \frac{dC}{dQ}$.
    \item \alert{Revenue/turnover} $p\cdot Q$ is the income from selling at price $p$.
   \item \alert{Contribution margin} is the revenue minus variable costs  $CM(Q) = p\cdot Q - C_{var}(Q)$, i.e. the contribution towards covering the fixed costs.
  \end{itemize}
\end{frame}


\begin{frame}
  \frametitle{Total cost consideration}

  Consider a firm with 3 product lines $A,B,C$. Which should they discontinue?

  \centering
  \renewcommand{\arraystretch}{1.35}
  \begin{tabular}{lrrr}
    \toprule & A & B & C \\
    \midrule
    Turnover & 800 & 500 & 700 \\
    \midrule
    Variable costs & 350 & 150 & 400 \\
    Fixed costs & 150 & 150 & 500 \\
    Total costs & 500 & 300 & 900 \\
    \midrule
    Operating profit & 300 & 200 & \alert{$-200$} \\
    \midrule
    Total profit & \multicolumn{3}{c}{\alert{300}} \\
    \bottomrule
  \end{tabular}

\end{frame}


\begin{frame}
  \frametitle{Total cost consideration without $C$}

  Discontinuing $C$ leads to a worse outcome because fixed costs still need to be paid.

  \centering
  \renewcommand{\arraystretch}{1.35}
  \begin{tabular}{lrrr}
    \toprule & A & B & C \\
    \midrule
    Turnover & 800 & 500 & 0 \\
    \midrule
    Variable costs & 350 & 150 & 0 \\
    Fixed costs & 150 & 150 & 500 \\
    Total costs & 500 & 300 & 500 \\
    \midrule
    Operating profit & 300 & 200 & \alert{$-500$} \\
    \midrule
    Total profit & \multicolumn{3}{c}{\alert{0}} \\
    \bottomrule
  \end{tabular}

\end{frame}


\begin{frame}
  \frametitle{Contribution margin}

  Consider \alert{contribution margin}: revenue/turnover minus variable costs. This is the contribution to covering the fixed costs.

  \centering
  \renewcommand{\arraystretch}{1.35}
  \begin{tabular}{lrrr}
    \toprule & A & B & C \\
    \midrule
    Turnover & 800 & 500 & 700 \\
    Variable costs & 350 & 150 & 400 \\
    Contribution margin & 450 & 350 & \alert{300} \\
    \midrule
    Total contribution margin & \multicolumn{3}{c}{1100} \\
    Fixed costs & \multicolumn{3}{c}{800} \\
    \midrule
    Total profit & \multicolumn{3}{c}{\alert{300}} \\
    \bottomrule
  \end{tabular}

\end{frame}

\begin{frame}
  \frametitle{Contribution margin: lessons}

  In the \alert{short-run} it's better to partly cover fixed costs instead of stopping production.

  $\Rightarrow$ Ignore fixed costs in the short-run.

  $\Rightarrow$ Maintain production as long as contribution margin (revenue minus variable costs) is positive.

  Variable costs can change in the short term (gas, electricity, oil, iron ore, etc.).

  In the \alert{long-run} if the contribution margin is persistently less than fixed costs, consider scrapping plant to remove fixed costs (if investment is already paid off).

\end{frame}





\begin{frame}
  \frametitle{Cost structure: cubic example}

  Consider a cubic total cost function $C(Q) = \frac{1}{3} Q^3 - 2Q^2 + 5Q + 15$, units EUR.

  \centering
  \begin{tikzpicture}
    \begin{axis}[
      width=11.5cm,height=5.0cm,axis lines=left,
      xlabel={quantity $Q$},ylabel={Costs [EUR]},
      xmin=0,xmax=6.3,ymin=0,ymax=55,
      xtick={0,1,...,6},ytick={0,10,...,50},
      samples=100,domain=0:6.2,
      label style={font=\small},tick label style={font=\scriptsize},
      legend style={font=\scriptsize,draw=none,fill=white,
        at={(.02,.98)},anchor=north west},legend cell align=left]
      \addplot[blue,very thick] {eecvar(x)+15};
      \addlegendentry{$C(Q)$: total costs}
    \end{axis}
  \end{tikzpicture}
\end{frame}


\begin{frame}
  \frametitle{Cubic example: fixed and variable costs}

  The \alert{fixed costs} do not depend on $Q$, $C_{fix} = 15$, while the \alert{variable costs} are the $Q$-dependent part  $C_{var}(Q) =  \frac{1}{3}Q^3 - 2Q^2 + 5Q$ with $C(Q) =C_{fix} + C_{var}(Q)$.

  \vspace{.5cm}

  \centering
  \begin{tikzpicture}
    \begin{axis}[
      width=11.5cm,height=5.0cm,axis lines=left,
      xlabel={quantity $Q$},ylabel={Costs [EUR]},
      xmin=0,xmax=6.3,ymin=0,ymax=55,
      xtick={0,1,...,6},ytick={0,10,...,50},
      samples=100,domain=0:6.2,
      label style={font=\small},tick label style={font=\scriptsize},
      legend style={font=\scriptsize,draw=none,fill=white,
        at={(.02,.98)},anchor=north west},legend cell align=left]
      \addplot[blue,very thick] {eecvar(x)+15};
      \addlegendentry{$C(Q)$: total costs}
      \addplot[purple,very thick] {eecvar(x)};
      \addlegendentry{$C_{\mathrm{var}}(Q)$: variable costs}
      \addplot[gray,thick,dashed] {15};
      \addlegendentry{$C_{\mathrm{fix}}=15$}
    \end{axis}
  \end{tikzpicture}

\end{frame}


\begin{frame}
  \frametitle{Marginal cost}

  The \alert{marginal cost} is the cost of the next incremental unit of production. This is the definition of the derivative. Since $C_{fix}$ does not depend on $Q$, the marginal cost only depends on the variable costs:
  \begin{equation*}
    MC(Q) = \frac{dC(Q)}{dQ} =  \frac{dC_{var}(Q)}{dQ}
  \end{equation*}
  For our cubic example $C(Q) = \frac{1}{3} Q^3 - 2Q^2 + 5Q + 15$, the marginal costs are 
$\frac{dC_{\textrm{var}}}{dQ}  = Q^2 - 4Q + 5$.
  
  \centering
  \begin{tikzpicture}
    \begin{axis}[
      width=11.5cm,height=4.0cm,axis lines=left,
      xlabel={quantity $Q$},ylabel={EUR per unit},
      xmin=0,xmax=6.3,ymin=0,ymax=13,
      xtick={0,1,...,6},ytick={0,2,...,12},
      samples=100,domain=0:6.2,
      label style={font=\small},tick label style={font=\scriptsize},
      legend style={font=\scriptsize,draw=none,fill=white,
        at={(.02,.98)},anchor=north west}]
      \addplot[green!55!black,very thick] {eecmc(x)};
      \addlegendentry{$MC(Q)=Q^2-4Q+5$}
    \end{axis}
  \end{tikzpicture}
\end{frame}


\begin{frame}
  \frametitle{Recall different market forms}
  \alert{Perfect competition}:
  \begin{itemize}
  \item many buyers and sellers, none of whom can influence price
  \item goods homogeneous
  \item all have perfect information
  \item no entry or exit barriers
  \end{itemize}

  \alert{Monopoly}:
  \begin{itemize}
  \item single seller who can use \alert{market power} to influence the price
  \end{itemize}

  \alert{Cournot oligopoly}:
  \begin{itemize}
  \item several sellers
  \item no cooperation/collusion among them
  \end{itemize}
\end{frame}


\begin{frame}
  \frametitle{Profit maximisation}

  A firm wants to maximise its profits $\Pi$, i.e. revenue $p\cdot Q$ minus costs $C(Q)$, by changing its production $Q$:
  \begin{equation*}
    \Pi = p\cdot Q - C(Q)
  \end{equation*}
  Looking for the maximum $\max_{Q\geq 0} \Pi(Q)$ we find:
  \begin{equation*}
    0 = \frac{d\Pi}{dQ} = \frac{d\left(p\cdot Q\right)}{dQ} - \frac{dC(Q)}{dQ}  = \frac{dp}{dQ}\cdot Q + p - \frac{dC(Q)}{dQ}
  \end{equation*}

  For \alert{perfect competition} the firm is a \alert{price taker} so that it has no influence on the price $\frac{dp}{dQ} = 0$ and thus:
  \begin{equation*}
    p = \frac{dC(Q)}{dQ}
  \end{equation*}
  For a given price $p$ from the market, it adjusts its output until its \alert{marginal cost} $\frac{dC(Q)}{dQ}$ is equal to the price. This is a central result of microeconomics!


  For a \alert{monopoly} where the firm has market power we have to do more work since $\frac{dp}{dQ} \neq 0$.
\end{frame}



\begin{frame}
  \frametitle{Profit maximisation under perfect competition: cubic example}


  \small
  Total costs are $C(Q) = \frac{1}{3} Q^3 - 2Q^2 + 5Q + 15$. The producer is a price taker under perfect competition. The market price is 10. What should the production be? Solve:
  \begin{equation*}
    10 = p = \frac{dC_{\textrm{var}}}{dQ}   \Rightarrow 10= Q^2 - 4Q + 5 \Rightarrow (Q-2)^2 = 9 \Rightarrow Q^* = 2\pm 3
  \end{equation*}
  The competitive market price $p=10$ meets marginal cost
  on its rising branch at $Q^*=5$ (negative production is impossible).

  \centering\eecostdiagram{1}
\end{frame}


\begin{frame}
  \frametitle{Production threshold and profit break-evens}

  From what price is production worthwhile? And from what price do we make a profit?

  The \alert{threshold for production} is the minimum price
  $p_{\textrm{prod}}$ at which revenue $p\cdot Q$ covers variable
  costs $C_{\textrm{var}}(Q)$. At this threshold the contribution margin is zero and we cannot cover any fixed costs.
  Below this threshold the production should be stopped.


  To find the production threshold, find the minimum of the average variable cost:
  \begin{equation*}
    p_{\textrm{prod}} = \min_{Q>0} \frac{C_{\textrm{var}}}{Q}
  \end{equation*}
  Solve:
  \begin{equation*}
    0 = \frac{d\left(\frac{C_{\textrm{var}}}{Q}\right)}{dQ} = \frac{1}{Q}  \frac{dC_{\textrm{var}}}{dQ} - \frac{1}{Q^2} C_{\textrm{var}} \Rightarrow \frac{C_{\textrm{var}}}{Q} = \frac{dC_{\textrm{var}}}{dQ}
  \end{equation*}
  i.e. production threshold is when average variable cost is equal to marginal cost.

\end{frame}

\begin{frame}
  \frametitle{Production threshold: cubic example}

  Production threshold: solve to find production $Q_{\textrm{prod}}$ at threshold:
  \begin{equation*}
    \frac{C_{\textrm{var}}}{Q} = \frac{dC_{\textrm{var}}}{dQ}   \Rightarrow \frac{1}{3} Q^2 - 2Q + 5 = Q^2 - 4Q + 5 \Rightarrow Q_{\textrm{prod}} = 3
  \end{equation*}
  Here price is $p_{\textrm{prod}} = \frac{C_{\textrm{var}}(Q_{\textrm{prod}})}{Q_{\textrm{prod}}} = \frac{dC_{\textrm{var}}}{dQ} = 2$ at point $C$.

  
  \centering\eecostdiagram{2}
\end{frame}


\begin{frame}
  \frametitle{Relation to the supply curve}

  The inverse supply function is the marginal cost starting from the production threshold $p_{\textrm{prod}}$:

  \centering\eecostsupplydiagram

  \raggedright\small At $C$, $Q_{\mathrm{prod}}=3$ and $p_{\mathrm{prod}}=2$.
  For $p<p_{\mathrm{prod}}$, the firm supplies $Q=0$.

\end{frame}


\begin{frame}
  \frametitle{Production and profit break-evens}

  The \alert{break-even for profit} is the minimum price $p_{\textrm{break}}$ at which revenue
 $p\cdot Q$ covers total
  costs $C(Q)$. At this threshold the contribution margin equals the fixed costs.

  To find the break-even price, find the minimum of the average total cost:
  \begin{equation*}
    p_{\textrm{break}} = \min_{Q>0} \frac{C}{Q}
  \end{equation*}
  Solve:
  \begin{equation*}
    0 = \frac{d\left(\frac{C}{Q}\right)}{dQ}  = \frac{1}{Q}  \frac{dC}{dQ} - \frac{1}{Q^2} C(Q) \Rightarrow \frac{C}{Q} = \frac{dC_{\textrm{var}}}{dQ}
  \end{equation*}
  i.e. profit break-even is when average cost is equal to marginal cost.

\end{frame}

\begin{frame}
  \frametitle{Profit break-even: cubic example}
  Break-even: solve to find production $Q_{\textrm{break}}$ at break-even:
  \begin{equation*}
    \frac{C}{Q} = \frac{dC_{\textrm{var}}}{dQ}   \Rightarrow \frac{1}{3} Q^2 - 2Q + 5 + \frac{15}{Q} = Q^2 - 4Q + 5 \Rightarrow Q_{\textrm{break}} = 4.25
  \end{equation*}
  Here price is $p_{\textrm{break}} =  \frac{C(Q_{\textrm{break}})}{Q_{\textrm{break}}} = \frac{dC_{\textrm{var}}}{dQ} \approx 6.05$ at $B$.

  \centering\eecostdiagram{3}
\end{frame}




\begin{frame}
  \frametitle{Cost structure: cubic example}

  If producer is price taker in market with price $p$, it adjusts its output $Q$ so that $\frac{dC}{dQ} = p$ (A).

  Production threshold (C) and profit break-even (B) are also marked.

  \centering
  \eecostdiagram{4}
\end{frame}


\section{Monopolies}




\begin{frame}
  \frametitle{Profit-maximisation in a monopoly}

  In a \alert{monopoly} situation there is a single producer that can manipulate the price $p(Q)$ by changing its output $Q$ to maximise its profit. The price is no longer set externally.

  Now the profits are given by revenue minus costs:
  \begin{equation*}
    \Pi(Q) = R(Q) - C(Q) = p(Q)\cdot Q - C(Q)
  \end{equation*}
  Looking for the maximum $\max_{Q \geq 0} \Pi(Q)$ we find:
  \begin{equation*}
    0 = \frac{d\Pi}{dQ} =  \frac{dR(Q)}{dQ} - \frac{dC(Q)}{dQ} = \frac{d\left(p\cdot Q\right)}{dQ} - \frac{dC(Q)}{dQ}  = \frac{dp}{dQ}\cdot Q + p - \frac{dC(Q)}{dQ}
  \end{equation*}

  Unlike the case of perfect competition, we now have $\frac{dp}{dQ} \neq 0$ and we find at the optimal point:
  \begin{equation*}
\frac{dC(Q)}{dQ} =   \frac{dR(Q)}{dQ}  = p + \frac{dp}{dQ}\cdot Q  = p\left( 1 + \frac{1}{\eta_{p,Q}}\right)
  \end{equation*}
  Since the price-demand elasticity is (usually) negative $\eta_{p,Q} < 0$ we can see that in a monopoly that $p > \frac{dC(Q)}{dQ}$, i.e. the price is \alert{higher} than the marginal costs and thus higher than it would be with perfect competition.
\end{frame}



\begin{frame}
  \frametitle{Special case: linear demand function}
  \begin{columns}[T]
  \begin{column}{7cm}
  \begin{tikzpicture}[
    scale=1.5,
    demand/.style={blue, thick},
    supply/.style={red, thick},
    axis/.style={very thick, ->, >=stealth', line join=miter},
    important line/.style={thick}, dashed line/.style={dashed, thin},
    every node/.style={color=black},
    dot/.style={circle,fill=black,minimum size=4pt,inner sep=0pt,
      outer sep=-1pt},
  ]
  % axis
  \draw[axis,<->] (2.5,0) node(xline)[right] {quantity $Q$} -|
  (0,2.5) node(yline)[above] {price $p$};
  % demand-supply diagram
  \draw[demand] (0,2) coordinate (demand_1) node[left] {$a$} --
           (2,0) coordinate (demand_2) node[right] {};
  \draw[demand,dashed line]
  (0,2)  node{} -- (1,0) node[below]{$\frac{a}{2b}$};
  \node[below] at (2,0) {$\frac{a}{b}$};

  \node[right] at (1,1) {$p_D(Q) = a - b \cdot Q$};

  \node[right] at (0.7,0.5) {$\frac{dR(Q)}{dQ} = a - 2\cdot b \cdot Q$};


  \begin{scope}[yshift=-2cm]
  % axis
  \draw[axis,<->] (2.5,0) node(xline)[right] {quantity $Q$} -|
  (0,1.5) node(yline)[above] {revenue $R$};

  \draw[supply] (1,1.2) parabola (2,0);
  \draw[supply] (1,1.2) parabola (0,0);
  \end{scope}


\end{tikzpicture}
  \end{column}
  \begin{column}{7cm}


  Suppose we are in a market where the consumers can be described by a linear aggregated inverse demand function:
  \begin{equation*}
    p_D(Q) = a - b \cdot Q
  \end{equation*}
  The revenue $R(Q)$ is given by
  \begin{equation*}
    R(Q) = p_D(Q)\cdot Q = a\cdot Q - b \cdot Q^2
  \end{equation*}
  The \alert{marginal revenue} is given by
  \begin{equation*}
    \frac{dR(Q)}{dQ} = a - 2\cdot b \cdot Q
  \end{equation*}
  The marginal revenue is linear with double the slope of the inverse demand function.
  \end{column}
  \end{columns}
\end{frame}

\begin{frame}
  \frametitle{Monopoly with linear demand function}


  Consider a monopoly producer with linear inverse demand function $p(Q) = a - b\cdot Q$.

  \begin{columns}[T]
  \begin{column}{7cm}
  \begin{tikzpicture}[
    scale=1.6,
    demand/.style={blue, thick},
    supply/.style={red, thick},
    axis/.style={very thick, ->, >=stealth', line join=miter},
    important line/.style={thick}, dashed line/.style={dashed, thin},
    every node/.style={color=black},
    dot/.style={circle,fill=black,minimum size=4pt,inner sep=0pt,
      outer sep=-1pt},
  ]
  % axis
  \draw[axis,<->] (2.5,0) node(xline)[right] {quantity $Q$} -|
  (0,2.5) node(yline)[above] {price $p$};
  % demand-supply diagram
  \draw[demand] (0,2) coordinate (demand_1) node[left] {a} --
           (2,0) coordinate (demand_2) node[right] {};
  \draw[demand,dashed line]
  (0,2)  node{} -- (1,0) node[below]{$\frac{a}{2b}$};
  \node[below] at (2,0) {$\frac{a}{b}$};

  \draw[supply] (0,0.2) parabola (1.8,1.2)
    node[right] {$\frac{dC}{dQ}$};

  \draw[dashed line]
  (0,1.22) node[left]{$p_M$} -- (0.8,1.2) node[dot]{} -- (0.8,0) node[below]{$Q_M^*$};

  \draw[dashed line]
  (0,0.7) node[left]{$p_C$} -- (1.3,0.7) node[dot]{} -- (1.3,0) node[below]{$Q_C^*$};



\end{tikzpicture}
  \end{column}
  \begin{column}{7cm}
    For a monopoly, the optimal production level $Q_M^*$ is set when the marginal
    revenue equals the marginal cost:
    \begin{equation*}
      \frac{dR(Q)}{dQ} = a - 2 \cdot b \cdot Q = \frac{dC(Q)}{dQ}
    \end{equation*}
    Compare this production level and the resulting price $p_M$ to the
    case of perfect production where the production level $Q^*_C$ and price $p_C$ are set where the
    inverse demand function equals the marginal cost:
    \begin{equation*}
      p_D(Q) = a - b \cdot Q = \frac{dC(Q)}{dQ}
    \end{equation*}


  \end{column}
  \end{columns}

\end{frame}






\begin{frame}
  \frametitle{Welfare in monopoly with linear demand function}

  Now compare the producer and consumer surpluses in the two cases. In the monopoly situation the producer increases its surplus at the expense of the consumer and the overall total welfare.

  \begin{tikzpicture}[
    scale=1.7,
    demand/.style={blue, thick},
    supply/.style={red, thick},
    axis/.style={very thick, ->, >=stealth', line join=miter},
    important line/.style={thick}, dashed line/.style={dashed, thin},
    every node/.style={color=black},
    dot/.style={circle,fill=black,minimum size=4pt,inner sep=0pt,
      outer sep=-1pt},
  ]
  % axis
  \draw[axis,<->] (2.5,0) node(xline)[right] {quantity $Q$} -|
  (0,2.5) node(yline)[above] {$p$};
  % demand-supply diagram
  \draw[demand] (0,2) coordinate (demand_1)  node[left] {a} --
           (2,0) coordinate (demand_2) node[right] {};
  \draw[demand,dashed line]
  (0,2)  node{} -- (1,0) node[below]{$\frac{a}{2b}$};
  \node[below] at (2,0) {$\frac{a}{b}$};

  \draw[supply] (0,0.2) parabola (1.8,1.2)
    node[right] {$\frac{dC}{dQ}$};

  \draw[dashed line]
  (0,1.2) node[left]{$p_M$} -- (0.8,1.2) node[dot]{} -- (0.8,0) node[below]{$Q_M$};

  \draw[dashed line]
  (0,0.7) node[left]{$p_C$} -- (1.3,0.7) node[dot]{} -- (1.3,0) node[below]{$Q_C$};

  \draw[fill=red, fill opacity=0.3]
  (0,0.2) parabola (1.3,0.7) -- (0,0.7);
  \draw[fill=blue, fill opacity=0.3]
  (0,0.7) parabola (1.3,0.7) -- (0,2);

  \node[above] at (1.5,2.5) {perfect competition};



  \begin{scope}[xshift=4cm]

  % axis
  \draw[axis,<->] (2.5,0) node(xline)[right] {quantity $Q$} -|
  (0,2.5) node(yline)[above] {$p$};
  % demand-supply diagram
  \draw[demand] (0,2) coordinate (demand_1)  node[left] {a} --
           (2,0) coordinate (demand_2) node[right] {};
  \draw[demand,dashed line]
  (0,2)  node{} -- (1,0) node[below]{$\frac{a}{2b}$};
  \node[below] at (2,0) {$\frac{a}{b}$};

  \draw[supply] (0,0.2) parabola (1.8,1.2)
    node[right] {$\frac{dC}{dQ}$};

  \draw[dashed line]
  (0,1.2) node[left]{$p_M$} -- (0.8,1.2) node[dot]{} -- (0.8,0) node[below]{$Q_M$};

  \draw[dashed line]
  (0,0.7) node[left]{$p_C$} -- (1.3,0.7) node[dot]{} -- (1.3,0) node[below]{$Q_C$};

  \draw[fill=red, fill opacity=0.3]
  (0,0.2) parabola (0.8,0.4) -- (0.8,1.2) -- (0,1.2);
  \draw[fill=blue, fill opacity=0.3]
  (0.8,1.2) -- (0,1.2) -- (0,2);

  \node[above] at (1.5,2.5) {monopoly};

  \end{scope}

\end{tikzpicture}
\end{frame}



\begin{frame}
  \frametitle{Monopoly example: special case of linear supply costs}

  Now suppose that as well as a linear demand function $p_D(Q) = a - b \cdot Q$ we also have linear supply costs $C(Q) = c\cdot Q$ so that we have a constant supply function $p_S(Q) = \frac{dC}{dQ} = c$.

  What are $p_M, p_C, Q_M, Q_C$? What about the producer and consumer surpluses?

  \begin{tikzpicture}[
    scale=1.7,
    demand/.style={blue, thick},
    supply/.style={red, thick},
    axis/.style={very thick, ->, >=stealth', line join=miter},
    important line/.style={thick}, dashed line/.style={dashed, thin},
    every node/.style={color=black},
    dot/.style={circle,fill=black,minimum size=4pt,inner sep=0pt,
      outer sep=-1pt},
  ]
  % axis
  \draw[axis,<->] (2.5,0) node(xline)[right] {quantity $Q$} -|
  (0,2.5) node(yline)[above] {$p$};
  % demand-supply diagram
  \draw[demand] (0,2) coordinate (demand_1)  node[left] {a} --
           (2,0) coordinate (demand_2) node[right] {};
  \draw[demand,dashed line]
  (0,2)  node{} -- (1,0) node[below]{$\frac{a}{2b}$};
  \node[below] at (2,0) {$\frac{a}{b}$};

  \draw[supply] (0,0.5) node[left]{$c$} -- (2,0.5)
    node[right] {$\frac{dC}{dQ}$};


  \node[above] at (1.5,2.5) {perfect competition};



  \begin{scope}[xshift=4cm]

  % axis
  \draw[axis,<->] (2.5,0) node(xline)[right] {quantity $Q$} -|
  (0,2.5) node(yline)[above] {$p$};
  % demand-supply diagram
  \draw[demand] (0,2) coordinate (demand_1)  node[left] {a} --
           (2,0) coordinate (demand_2) node[right] {};
  \draw[demand,dashed line]
  (0,2)  node{} -- (1,0) node[below]{$\frac{a}{2b}$};
  \node[below] at (2,0) {$\frac{a}{b}$};

  \draw[supply] (0,0.5) node[left]{$c$} -- (2,0.5)
    node[right] {$\frac{dC}{dQ}$};


  \node[above] at (1.5,2.5) {monopoly};

  \end{scope}

\end{tikzpicture}
\end{frame}




\begin{frame}
  \frametitle{Monopoly example: special case of linear supply costs}


  For perfect competition $p_C = c$ and $Q_C = \frac{a-c}{b}$. Producer surplus is zero $PS = 0$, while consumer surplus is $CS = \frac{(a-c)^2}{2b}$.

  For monopoly $p_M = \frac{a+c}{2}$ and $Q_M = \frac{a-c}{2b}$ (half of perfect competition). Producer surplus is now non-zero $PS = \frac{(a-c)^2}{4b}$ and $CS = \frac{(a-c)^2}{8b}$.

  \begin{tikzpicture}[
    scale=1.7,
    demand/.style={blue, thick},
    supply/.style={red, thick},
    axis/.style={very thick, ->, >=stealth', line join=miter},
    important line/.style={thick}, dashed line/.style={dashed, thin},
    every node/.style={color=black},
    dot/.style={circle,fill=black,minimum size=4pt,inner sep=0pt,
      outer sep=-1pt},
  ]
  % axis
  \draw[axis,<->] (2.5,0) node(xline)[right] {quantity $Q$} -|
  (0,2.5) node(yline)[above] {$p$};
  % demand-supply diagram
  \draw[demand] (0,2) coordinate (demand_1)  node[left] {a} --
           (2,0) coordinate (demand_2) node[right] {};
  \draw[demand,dashed line]
  (0,2)  node{} -- (1,0) node[below]{$\frac{a}{2b}$};
  \node[below] at (2,0) {$\frac{a}{b}$};

  \draw[supply] (0,0.5) -- (2,0.5)
    node[right] {$\frac{dC}{dQ}$};

  \draw[dashed line]
  (0,1.25) node[left]{$p_M$} -- (0.75,1.25) node[dot]{} -- (0.75,0) node[below]{$Q_M$};

  \draw[dashed line]
  (0,0.5) node[left]{$p_C = c$} -- (1.5,0.5) node[dot]{} -- (1.5,0) node[below]{$Q_C$};

  \draw[fill=blue, fill opacity=0.3]
  (0,0.5) -- (1.5,0.5) -- (0,2);

  \node[above] at (1.5,2.5) {perfect competition};



  \begin{scope}[xshift=4cm]

  % axis
  \draw[axis,<->] (2.5,0) node(xline)[right] {quantity $Q$} -|
  (0,2.5) node(yline)[above] {$p$};
  % demand-supply diagram
  \draw[demand] (0,2) coordinate (demand_1)  node[left] {a} --
           (2,0) coordinate (demand_2) node[right] {};
  \draw[demand,dashed line]
  (0,2)  node{} -- (1,0) node[below]{$\frac{a}{2b}$};
  \node[below] at (2,0) {$\frac{a}{b}$};

  \draw[supply] (0,0.5) -- (2,0.5)
    node[right] {$\frac{dC}{dQ}$};


  \draw[dashed line]
  (0,1.25) node[left]{$p_M$} -- (0.75,1.25) node[dot]{} -- (0.75,0) node[below]{$Q_M$};

  \draw[dashed line]
  (0,0.5) node[left]{$p_C=c$} -- (1.5,0.5) node[dot]{} -- (1.5,0) node[below]{$Q_C$};

  \draw[fill=red, fill opacity=0.3]
  (0,0.5) -- (0.75,0.5) -- (0.75,1.25) -- (0,1.25);
  \draw[fill=blue, fill opacity=0.3]
  (0,1.25) -- (0.75,1.25) -- (0,2);

  \node[above] at (1.5,2.5) {monopoly};

  \end{scope}

\end{tikzpicture}
\end{frame}




\section{Cournot oligopoly}


\begin{frame}
  \frametitle{Cournot oligopoly}

  A \alert{Cournot oligopoly} is a simplified model that interpolates between the cases of a monopoly (only one supplier) and perfect competition with many suppliers. It has the following properties:

  \begin{itemize}
    \item More than one producing firm
    \item All firms produce one homogeneous product (no product
  differentiation)
    \item No cooperation among firms (no collusion)
  \item Firms have \alert{market power} - each firm's output decision affects
  the good's price
  \item Fixed number of firms
  \item Firms compete in quantities, and choose them simultaneously
  \item Economically rational and strategically acting firms, seeking to
    maximize profit given their competitors' decisions
  \end{itemize}

\end{frame}


\begin{frame}
  \frametitle{Cournot duopoly}

  Two identical firms produce the same good in quantities $Q_1,Q_2$
  with linear supply functions and the same marginal cost:
  \begin{align*}
    C_1(Q_1) &= c\cdot Q_1 \\
    C_2(Q_2) &= c\cdot Q_2
  \end{align*}

  The price is give through a linear demand function (with $a > c$):
  \begin{align*}
    p(Q_1,Q_2) = p(Q_1 + Q_2) = a - b \cdot (Q_1 + Q_2)
  \end{align*}

  The profit functions of the two firms are given by:
  \begin{align*}
    \Pi_1(Q_1) &= p(Q_1 + Q_2) \cdot Q_1 - C_1(Q_1) \\
    \Pi_2(Q_2) &= p(Q_1 + Q_2) \cdot Q_2 - C_2(Q_2)
  \end{align*}
\end{frame}

\begin{frame}
  \frametitle{Cournot duopoly}

  Consider the maximisation of the profit $\Pi_1$ of firm 1 assuming
  that the production $Q_2$ of firm 2 is constant and not affected by
  $Q_1$:
  \begin{align*}
    \frac{d\Pi_1}{dQ_1} & = p(Q_1 + Q_2) + \frac{dp}{dQ_1}\cdot Q_1 - \frac{dC_1}{dQ_1} = a - b\cdot(Q_1+Q_2) - bQ_1 - c \\
    & = a -c -2bQ_1 - bQ_2 = 0
  \end{align*}
  Similarly for the maximisation of the profit $\Pi_2$ of firm 2:
  \begin{align*}
    \frac{d\Pi_2}{dQ_2} & = p(Q_1 + Q_2) + \frac{dp}{dQ_2}\cdot Q_2 - \frac{dC_2}{dQ_2} = a - b\cdot(Q_1+Q_2) - bQ_2 - c \\
    & = a -c -bQ_1 - 2bQ_2 = 0
  \end{align*}

  From the second equation we can substitute $bQ_1 = a-c-2bQ_2$ into the first to get:
  \begin{align*}
    Q_2^* = \frac{a-c}{3b} = Q_1^*
  \end{align*}
  (note the symmetry between the identical firms) and as a result $p^* = \frac{a + 2c}{3}$.
\end{frame}

\begin{frame}
  \frametitle{Interpolation from monopoly to polipoly}

  Using the Cournot model we can interpolate between a monopoly $N=1$ and perfect competition for the case of linear supply costs $C_i(Q_i) = c \cdot Q_i$ and linear demand function $p_D(\sum_i Q) = a - b \cdot \sum_i Q_i$:

    \ra{1.5}
  \begin{table}[!t]
    \begin{tabular}{lcccc}
      \toprule
      market type & $N$ & price & sales per company & total sales \\
      \midrule
      monopoly & 1  & $p = \frac{a+c}{2}$ & $Q = \frac{a-c}{2b}$ & $\frac{1}{2}\frac{a-c}{b}$ \\
      duopoly & 2  & $p = \frac{a+2c}{3}$ & $Q_i = \frac{a-c}{3b}$ & $\frac{2}{3}\frac{a-c}{b}$ \\
      oligopoly & $N$ & $p = \frac{a+Nc}{N+1}$ & $Q_i = \frac{a-c}{b(N+1)}$ & $\frac{N}{N+1}\frac{a-c}{b}$ \\
      polipoly & $N \to \infty$ & $p = c$ &  $\to 0$  & $\frac{a-c}{b}$\\
      \bottomrule
    \end{tabular}
  \end{table}

\end{frame}

\end{document}
