GeneralHow to write this formula

LaTeX specific issues not fitting into one of the other forums of this category.
gcheer3
Posts: 41
Joined: Wed Jun 25, 2008 4:39 pm

How to write this formula

Post by gcheer3 »

I want to show the formula as in the pic.
I dont know how to change the line:
I tried this, but this formula is too long to fit the pape:
Thank you for your help

Code: Select all

     \alpha_{act}^{recalc}=\sum_{x_{11}=0}^{n_{11}}\sum_{x_{12}=0}^{n_{12}}\sum_{x_{21}=0}^{n_{21}}\sum_{x_{22}=0}^{n_{22}}\binom{n_{11}}{x_{11}}\binom{n_{12}}{x_{12}}\binom{n_{21}}{x_{21}}\binom{n_{22}}{x_{22}}\times\pi^{x} \, (1-\pi)^{n-x}\centerdot 1_{\left\{\chi^{2}\geq\chi^{2}_{1,1-\alpha}\right\}}

Then I tried this, still doesnt work

Code: Select all

   \[
   \begin{align}
     \alpha_{act}^{recalc} &=\sum_{x_{11}=0}^{n_{11}}\sum_{x_{12}=0}^{n_{12}}\sum_{x_{21}=0}^{n_{21}}\sum_{x_{22}=0}^{n_{22}}\binom{n_{11}}{x_{11}}\binom{n_{12}}{x_{12}}\binom{n_{21}}{x_{21}}\binom{n_{22}}{x_{22}}&\times\pi^{x} \, (1-\pi)^{n-x}\centerdot 1_{\left\{\chi^{2}\geq\chi^{2}_{1,1-\alpha}\right\}}
   \end{align}
   \]
Attachments
Clipboard01.jpg
Clipboard01.jpg (12.05 KiB) Viewed 5912 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

How to write this formula

Post by gmedina »

Try something like

Code: Select all

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{align}
  \begin{split}
  \alpha_{\text{act}}^{\text{recalc}}=
  &\sum_{x_{11}=0}^{n_{11}}\sum_{x_{12}=0}^{n_{12}}\sum_{x_{21}=0}^{n_{21}}\sum_{x_{22}=0}^{n_{22}}
  \binom{n_{11}}{x_{11}}\binom{n_{12}}{x_{12}}\binom{n_{21}}{x_{21}}\binom{n_{22}}{x_{22}}\\
  &\times\pi^{x} \, (1-\pi)^{n-x}\cdot 1_{\left\{\chi^{2}\geq\chi^{2}_{1,1-\alpha}\right\}}
  \end{split}
\end{align}

\end{document}
Basic documentation: amsmath documentation, mathmode.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
gcheer3
Posts: 41
Joined: Wed Jun 25, 2008 4:39 pm

Re: How to write this formula

Post by gcheer3 »

Also, how can I make an extra spacing between two rows ( not necessary for math, also for text)? I tried \par \par, but that didnt help. It cannot make double spacing between two lines.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

How to write this formula

Post by localghost »

You can tune the solution of gmedina a little bit by inserting a \quad right before the \times command at the beginning of the second line of the equation. So this line is indented as seen on the picture.
gcheer3 wrote:Also, how can I make an extra spacing between two rows ( not necessary for math, also for text)? I tried \par \par, but that didnt help. It cannot make double spacing between two lines.
Insert a vertical space after the line break.

Code: Select all

\begin{align}
  \alpha_\text{act}^\text{recalc}
  \begin{split}
    &=\sum_{x_{11}=0}^{n_{11}}\sum_{x_{12}=0}^{n_{12}}\sum_{x_{21}=0}^{n_{21}}\sum_{x_{22}=0}^{n_{22}}\binom{n_{11}}{x_{11}}\binom{n_{12}}{x_{12}}\binom{n_{21}}{x_{21}}\binom{n_{22}}{x_{22}} \\[2\baselineskip]
    &\quad\times\pi^{x} \, (1-\pi)^{n-x}\cdot 1_{\left\{\chi^{2}\geq\chi^{2}_{1,1-\alpha}\right\}}
  \end{split}
\end{align}

Best regards
Thorsten¹
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Re: How to write this formula

Post by Stefan Kottwitz »

Hi,

just a short remark: align is not necessary in the given solution, a simple equation environment with the split environment inside is enough. Notice that Thorsten set the & separation symbol before the = relation symbol, gmedina set it before \sum, I prefer &= and the \quad in the next line like Thorsten said.

Stefan
LaTeX.org admin
gcheer3
Posts: 41
Joined: Wed Jun 25, 2008 4:39 pm

Re: How to write this formula

Post by gcheer3 »

Thank you for you guys help.

The typeset looks good as in the pic. But there is a problem. It automatically generate a formula number "(1)" behind the formula, I dont want that number. How can I delete the formula number?

The second question I asked is kind of confusing. Sorry for that. The second questions is not related to the first question.
I am making slides using beamer. I write a paragraph, then I want to begin another paragraph, I want to show the distance betwen this two paragraph.
eg. "I appreciate all you help today and before.


It is very nice to get response online promptly."

Instead of "I appreciate all you help today and before.
It is very nice to get response online promptly"

I want extra spacing between two sentences. \par \par didnt work
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

How to write this formula

Post by gmedina »

Use the starred versions:

Code: Select all

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{align*}
  \begin{split}
  \alpha_{\text{act}}^{\text{recalc}}=
  &\sum_{x_{11}=0}^{n_{11}}\sum_{x_{12}=0}^{n_{12}}\sum_{x_{21}=0}^{n_{21}}\sum_{x_{22}=0}^{n_{22}}
  \binom{n_{11}}{x_{11}}\binom{n_{12}}{x_{12}}\\
  &\times\binom{n_{21}}{x_{21}}\binom{n_{22}}{x_{22}}
  \pi^{x} \, (1-\pi)^{n-x}\cdot 1_{\left\{\chi^{2}\geq\chi^{2}_{1,1-\alpha}\right\}}
  \end{split}
\end{align*}

\end{document}
As Stefan_K pointed out you can use equation instead of align; in this case, equation* will do the job.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

How to write this formula

Post by Stefan Kottwitz »

gcheer3 wrote:It automatically generate a formula number "(1)" behind the formula, I dont want that number. How can I delete the formula number?
Use the corresponding starred environment: equation* or align*.
gcheer3 wrote:I want to show the distance betwen this two paragraph.
Just at this position you could write \bigskip or \vspace{distance}. Or you set \parskip.

Stefan
LaTeX.org admin
gcheer3
Posts: 41
Joined: Wed Jun 25, 2008 4:39 pm

Re: How to write this formula

Post by gcheer3 »

yes, \begin{equation}and\end{equation} worked well, but there is still a equation number which I dont want.

I used \\[2\baselineskip] between text, it didnt work. It worked so well in that formula. I used \\[0.5\baselineskip]. the formula turned out perfect
gcheer3
Posts: 41
Joined: Wed Jun 25, 2008 4:39 pm

Re: How to write this formula

Post by gcheer3 »

Sorry, Stefan, I didnt see you last post. Everything works well now.

Gmedina, Thorsten, Stefan, Thank you:-)
Post Reply