1

In the example below, would it be possible to be lenient with the inequality on the right side of the curly bracket so that it (and only that part) could extend out of the margin ? (this way the numbering on the left hand side and the equations can all be in the same line)

\documentclass[leqno,10pt]{article}
\usepackage{soul}
\usepackage[margin=0.75in]{geometry}
\def\changemargin#1#2{\list{}{\rightmargin#2\leftmargin#1}\item[]}
\let\endchangemargin=\endlist 
\usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{Lecture 1}
\rhead{Handout 3}
\usepackage{mathtools}
\usepackage{enumitem,array}
\usepackage{relsize}
\usepackage{amsmath}
\usepackage{amsthm} %for proof 
\newtheorem*{mythm}{Theorem}
\newtheorem*{mydef}{Definition}
\newtheorem*{mycases}{Special Cases}
\title{\ul{Conditional Expectations in Bivariate Probability Distribution}}
\date{}
\newenvironment{mydescription}{%
   \renewcommand\descriptionlabel[1]{\hspace{\labelsep}\textbf{{##1}}}%
   \begin{description}%
}{%
   \end{description}%
}
\newenvironment{definition}[1][Definition]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}]}{\end{trivlist}}

\providecommand\given{} 
\DeclarePairedDelimiterX{\EV}[1]{E(}{)}{\renewcommand\given{\nonscript\,\delimsize\vert\nonscript\,} #1}
\providecommand\iven{} 
\DeclarePairedDelimiterX{\V}[1]{V(}{)}{\renewcommand\iven{\nonscript\,\delimsize\vert\nonscript\,} #1}

\begin{document}

\newenvironment{Myitemize}{%
\renewcommand{\labelitemi}{{}}%
\begin{itemize}[nosep]}{\end{itemize}}

\maketitle

\newcommand{\myitem}{\stepcounter{enumi}\item[(\theenumi)]}%for enumerate with no. in brackets
\newcommand\litem[1]{\item{\bfseries {#1}}}

\thispagestyle{fancy}

\begin{mydef} 
If the random vector $(X,Y)$ has joint \textbf{pdf} $f(x,y)$ with conditional \textbf{pdf} $g_{2}(y|x)$, and if $Z=h(X,Y)$ is a (single-valued) function of (X,Y). Then the conditional expectation of the random variable $Z$, given $X=x$ is 
\begin{equation}
E(Z|x)=\int_{-\infty}^{\infty}{h(x,y)g_{2}(y|x)dy}
\label{eq:}
\end{equation}
\end{mydef} 

\begin{mycases}
(a,b,c are constants; ($X^{*}=X-E(X); Y^{*}=Y-E(Y)$)\\
\begin{flalign}\label{cas}
    & Z=a+bX+cY & \Rightarrow\quad & \!\begin{aligned}[t]\EV{Z \given x}&=\EV{a \given x}+b.\EV{X \given x}+c.\EV{Y \given x} \\&= a+bx+c.\EV{Y \given x} \end{aligned} &\hphantom{Z=a+bX+cY\quad(2)} & \\
   & Z=XY & \Rightarrow\quad & \EV{Z \given x} = x\EV{Y \given x}\\
 & Z = Y & \Rightarrow\quad & \EV{Z \given x} = \EV{Y \given x} = \mu_{Y|x} = \text{The CE of Y given X}\\
 & Z=(Y-\mu_{Y|X})^{2} &\Rightarrow\quad & \EV{Z \given x} = \V{Y \iven x} = \sigma^{2}_{Y|x}=\text{The CV of Y given X}
\smash{\raisebox{-10pt}{$\left.\rule{0pt}{17pt}\right\} \EV{(Y-\mu_{Y|X})^{2} \given X}\leq \EV{Y-\mu_{Y})^{2} \given X}$}}\\
 & Z=(Y-\mu_{Y})^{2} & \Rightarrow\quad & \EV{Z \given x} = \V{Y \iven x} + (\mu_{Y|x}-\mu_{Y})^2
\end{flalign}

\end{mycases}

\end{document}
1

This does what you ask, though you may consider an alternative, since it pushes up to the paper edge. Nonetheless, I did two things to your MWE. First, I wrapped the \smash{} in an \rlap, as in \rlap{\smash{}}. This has the effect of ignoring the horizontal space taken by the argument of \rlap as it laps rightward from the current position (thus it prevents LaTeX from detecting the associated margin overrun). I also inserted a \! small negative space after the brace, to try to provide some relief at the right margin.

\documentclass[leqno,10pt]{article}
\usepackage{soul}
\usepackage[margin=0.75in]{geometry}
\def\changemargin#1#2{\list{}{\rightmargin#2\leftmargin#1}\item[]}
\let\endchangemargin=\endlist 
\usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{Lecture 1}
\rhead{Handout 3}
\usepackage{mathtools}
\usepackage{enumitem,array}
\usepackage{relsize}
\usepackage{amsmath}
\usepackage{amsthm} %for proof 
\newtheorem*{mythm}{Theorem}
\newtheorem*{mydef}{Definition}
\newtheorem*{mycases}{Special Cases}
\title{\ul{Conditional Expectations in Bivariate Probability Distribution}}
\date{}
\newenvironment{mydescription}{%
   \renewcommand\descriptionlabel[1]{\hspace{\labelsep}\textbf{{##1}}}%
   \begin{description}%
}{%
   \end{description}%
}
\newenvironment{definition}[1][Definition]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}]}{\end{trivlist}}

\providecommand\given{} 
\DeclarePairedDelimiterX{\EV}[1]{E(}{)}{\renewcommand\given{\nonscript\,\delimsize\vert\nonscript\,} #1}
\providecommand\iven{} 
\DeclarePairedDelimiterX{\V}[1]{V(}{)}{\renewcommand\iven{\nonscript\,\delimsize\vert\nonscript\,} #1}

\begin{document}

\newenvironment{Myitemize}{%
\renewcommand{\labelitemi}{{}}%
\begin{itemize}[nosep]}{\end{itemize}}

\maketitle

\newcommand{\myitem}{\stepcounter{enumi}\item[(\theenumi)]}%for enumerate with no. in brackets
\newcommand\litem[1]{\item{\bfseries {#1}}}

\thispagestyle{fancy}

\begin{mydef} 
If the random vector $(X,Y)$ has joint \textbf{pdf} $f(x,y)$ with conditional \textbf{pdf} $g_{2}(y|x)$, and if $Z=h(X,Y)$ is a (single-valued) function of (X,Y). Then the conditional expectation of the random variable $Z$, given $X=x$ is 
\begin{equation}
E(Z|x)=\int_{-\infty}^{\infty}{h(x,y)g_{2}(y|x)dy}
\label{eq:}
\end{equation}
\end{mydef} 

\begin{mycases}
(a,b,c are constants; ($X^{*}=X-E(X); Y^{*}=Y-E(Y)$)\\
\begin{flalign}\label{cas}
    & Z=a+bX+cY & \Rightarrow\quad & \!\begin{aligned}[t]\EV{Z \given x}&=\EV{a \given x}+b.\EV{X \given x}+c.\EV{Y \given x} \\&= a+bx+c.\EV{Y \given x} \end{aligned} &\hphantom{Z=a+bX+cY\quad(2)} & \\
   & Z=XY & \Rightarrow\quad & \EV{Z \given x} = x\EV{Y \given x}\\
 & Z = Y & \Rightarrow\quad & \EV{Z \given x} = \EV{Y \given x} = \mu_{Y|x} = \text{The CE of Y given X}\\
 & Z=(Y-\mu_{Y|X})^{2} &\Rightarrow\quad & \EV{Z \given x} = \V{Y \iven x} = \sigma^{2}_{Y|x}=\text{The CV of Y given X}
\rlap{\smash{\raisebox{-10pt}{$\left.\rule{0pt}{17pt}\right\}\!\EV{(Y-\mu_{Y|X})^{2} \given X}\leq \EV{Y-\mu_{Y})^{2} \given X}$}}}\\
 & Z=(Y-\mu_{Y})^{2} & \Rightarrow\quad & \EV{Z \given x} = \V{Y \iven x} + (\mu_{Y|x}-\mu_{Y})^2
\end{flalign}

\end{mycases}

\end{document}

enter image description here


Here's an alternative, using a stack, that obeys the margin:

\documentclass[leqno,10pt]{article}
\usepackage{soul}
\usepackage[margin=0.75in]{geometry}
\usepackage{stackengine}
\stackMath
\def\changemargin#1#2{\list{}{\rightmargin#2\leftmargin#1}\item[]}
\let\endchangemargin=\endlist 
\usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{Lecture 1}
\rhead{Handout 3}
\usepackage{mathtools}
\usepackage{enumitem,array}
\usepackage{relsize}
\usepackage{amsmath}
\usepackage{amsthm} %for proof 
\newtheorem*{mythm}{Theorem}
\newtheorem*{mydef}{Definition}
\newtheorem*{mycases}{Special Cases}
\title{\ul{Conditional Expectations in Bivariate Probability Distribution}}
\date{}
\newenvironment{mydescription}{%
   \renewcommand\descriptionlabel[1]{\hspace{\labelsep}\textbf{{##1}}}%
   \begin{description}%
}{%
   \end{description}%
}
\newenvironment{definition}[1][Definition]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}]}{\end{trivlist}}

\providecommand\given{} 
\DeclarePairedDelimiterX{\EV}[1]{E(}{)}{\renewcommand\given{\nonscript\,\delimsize\vert\nonscript\,} #1}
\providecommand\iven{} 
\DeclarePairedDelimiterX{\V}[1]{V(}{)}{\renewcommand\iven{\nonscript\,\delimsize\vert\nonscript\,} #1}

\begin{document}

\newenvironment{Myitemize}{%
\renewcommand{\labelitemi}{{}}%
\begin{itemize}[nosep]}{\end{itemize}}

\maketitle

\newcommand{\myitem}{\stepcounter{enumi}\item[(\theenumi)]}%for enumerate with no. in brackets
\newcommand\litem[1]{\item{\bfseries {#1}}}

\thispagestyle{fancy}

\begin{mydef} 
If the random vector $(X,Y)$ has joint \textbf{pdf} $f(x,y)$ with conditional \textbf{pdf} $g_{2}(y|x)$, and if $Z=h(X,Y)$ is a (single-valued) function of (X,Y). Then the conditional expectation of the random variable $Z$, given $X=x$ is 
\begin{equation}
E(Z|x)=\int_{-\infty}^{\infty}{h(x,y)g_{2}(y|x)dy}
\label{eq:}
\end{equation}
\end{mydef} 

\begin{mycases}
(a,b,c are constants; ($X^{*}=X-E(X); Y^{*}=Y-E(Y)$)\\
\begin{flalign}\label{cas}
    & Z=a+bX+cY & \Rightarrow\quad & \!\begin{aligned}[t]\EV{Z \given x}&=\EV{a \given x}+b.\EV{X \given x}+c.\EV{Y \given x} \\&= a+bx+c.\EV{Y \given x} \end{aligned} &\hphantom{Z=a+bX+cY\quad(2)} & \\
   & Z=XY & \Rightarrow\quad & \EV{Z \given x} = x\EV{Y \given x}\\
 & Z = Y & \Rightarrow\quad & \EV{Z \given x} = \EV{Y \given x} = \mu_{Y|x} = \text{The CE of Y given X}\\
 & Z=(Y-\mu_{Y|X})^{2} &\Rightarrow\quad & \EV{Z \given x} = \V{Y \iven x} = \sigma^{2}_{Y|x}=\text{The CV of Y given X}
\rlap{\smash{\raisebox{-10pt}{$\left.\rule{0pt}{17pt}\right\}\quad
\def\stackalignment{r}
\stackanchor{\EV{(Y-\mu_{Y|X})^{2} \given X}\leq\quad}{\EV{Y-\mu_{Y})^{2} \given X}}$}}}\\
 & Z=(Y-\mu_{Y})^{2} & \Rightarrow\quad & \EV{Z \given x} = \V{Y \iven x} + (\mu_{Y|x}-\mu_{Y})^2
\end{flalign}

\end{mycases}

\end{document}

enter image description here

  • 1
    it doesn't seem really necessary to have quite so much space before the \Rightarrows. reducing that would decrease the margin overrun. (there may be something somewhere else that dictates this space, but worth checking.) – barbara beeton Aug 29 '14 at 15:38
  • 1
    @barbarabeeton I agree with you, but didn't want to presume what the OP wanted on the left side. I have offered an alternative that stacks the right side to obey margin control. – Steven B. Segletes Aug 29 '14 at 15:40
  • @StevenB.Segletes: Thanks for the lovely solutions as well as the explanations. Much appreciated – Abhimanyu Arora Aug 29 '14 at 16:21
1

Using \mathrlap (from mathtools), you can achieve what you want. It is not an advisable practice, but maybe acceptable in some situations. One can place the \Rightarrow more leftwise inserting a relevant horizontal space in the third column of the alignment (to be determined experimentally).

Here are the details:

\documentclass[leqno,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{soulutf8}
\usepackage[margin=0.75in]{geometry}
\def\changemargin#1#2{\list{}{\rightmargin#2\leftmargin#1}\item[]}
\let\endchangemargin=\endlist
\usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{Lecture 1}
\rhead{Handout 3}
\usepackage{mathtools}
\usepackage{enumitem,array}
\usepackage{relsize}
\usepackage{amsmath}
\usepackage{amsthm} %for proof
\newtheorem*{mythm}{Theorem}
\theoremstyle{definition}
\newtheorem*{mydef}{Definition}
\newtheorem*{mycases}{Special Cases}
\title{\ul{Conditional Expectations in Bivariate Probability Distribution}}
\date{}

    \providecommand\given{}
    \DeclarePairedDelimiterXPP\EV[1]{E}(){}{
    \renewcommand\given{\nonscript\,\delimsize\vert\nonscript\,}
    #1}

    \DeclarePairedDelimiterXPP\V[1]{V}(){}{
    \renewcommand\given{\nonscript\,\delimsize\vert\nonscript\,}
    #1}

\begin{document}

\newenvironment{Myitemize}{%
\renewcommand{\labelitemi}{{}}%
\begin{itemize}[nosep]}{\end{itemize}}

\maketitle

\newcommand{\myitem}{\stepcounter{enumi}\item[(\theenumi)]}%for enumerate with no. in brackets
\newcommand\litem[1]{\item{\bfseries {#1}}}

\thispagestyle{fancy}

\begin{mydef}
If the random vector $(X,Y)$ has joint \textbf{pdf} $f(x,y)$ with conditional \textbf{pdf} $g_{2}(y\,\vert\,x)$, and if $Z=h(X,Y)$ is a (single-valued) function of (X,Y). Then the conditional expectation of the random variable $Z$, given $X=x$ is
\begin{equation}
\EV{Z \given x}=\int_{-\infty}^{\infty}{h(x,y)g_{2}(y\,\vert\, x)dy}
\label{eq:}
\end{equation}
\end{mydef}

\begin{mycases}
(a,b,c are constants; ($X^{*}=X-E(X); Y^{*}=Y-E(Y)$)\\
\begin{flalign}\label{cas}
    & Z=a+bX+cY & \Rightarrow\quad &\EV{Z \given x}\!\begin{aligned}[t] &= \EV{a \given x}+b.\EV{X \given x}+c.\EV{Y \given x} \\&= a+bx+c.\EV{Y \given x} \end{aligned} & \hskip 5.1cm &
    \\
  & Z=XY & \Rightarrow \quad & \EV{Z \given x} = x\EV{Y \given x} & & \\
 & Z = Y & \Rightarrow\quad& \EV{Z \given x} = \EV{Y \given x} = \mu_{Y|x} = \text{The CE of Y given X}\\
 & Z=(Y-\mu_{Y|X})^{2} &\Rightarrow\quad & \mathrlap{\begin{rcases}\EV{Z \given x} = \V{Y \given x} = \sigma^{2}_{Y|x}=\text{The CV of Y given X}
\end{rcases}\EV{(Y-\mu_{Y|X})^{2} \given X}\leq\EV{()Y-\mu_{Y})^{2} \given X}}&
\\
 & Z=(Y-\mu_{Y})^{2} & \Rightarrow\quad & \EV{Z \given x} = \V{Y \given x} + (\mu_{Y|x}-\mu_{Y})^2
\end{flalign}
\end{mycases}

\end{document} 

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.