1 Attachment(s)

display an algorithm in latex

i want to type an algorithm in latex

i have a mac and i am using texshop

i want to display the algorithm as seen in the attachment

do i need to download and install soltware?

please help me type it or explain to me how to load the picture into my paper!

i need a step by step guide here!

thanks in advance

help- typo? i'm losing my mind!

I can not get this to display properly, i kee running into a problem on the bolded line....

can anyone tell me when my "error" is?

\documentclass[11 pt]{article}

\author{Emily}

\title{An Algorithm for Computing Gr\"obner Bases}

\renewcommand{\baselinestretch}{1.5}

\newtheorem{ex}{Example}[section]

\newtheorem{thm}{Theorem}[section]

\newtheorem{deff}{Definition}[section]

\usepackage{algorithm}

\usepackage{algorithmic}

\begin{document}

\maketitle

\section{Algorithm}

\begin{algorithm}

\caption{Buchberger's Algorithm}

\begin{algorithmic}

\REQUIRE A polynomial set $F = \{f_1, \dots ,f_n\}$, that generates an ideal $I $

\ENSURE A Gr\"obner basis $G = \{g_1, \dots , g_t\}$, that generates the same ideal $I$ with $F \subset G$

\STATE $G := F$

\STATE $M := \{f_i, f_j\} | f_i, f_j \in G$ and $f_i \neq f_j\}

\REPEAT

**\STATE $\{p, q\} :=$ a pair in $M$**

\STATE $M := M – \{\{p, q\}\}$

\STATE $S := Spoly(p, q)$

\STATE $h := NormalForm(S, G)$

\IF{$h \neq 0$}

\STATE $M := M \cup \{\{ g , h \}\} \forall g\in G \}$

\ENDIF

\UNTIL{M=0}

\end{algorithmic}

\end{algorithm}

\end{document}