\title{Choisir un algorithme}
\author{Bernadette Perrin-Riou}
\email{bpr@math.u-psud.fr}

\real{b = randint(2..20)}
\real{k = randitem(1,1,2,2,randint(0..5))}
\real{bk= \b^(\k)}
\real{a = randitem(randint(1..\bk),randint(\bk + 5), \bk)}
\real{c = randint(2..50)/10}
\real{c1 = randint(2..100)/10}
\text{f = simplify(\c*n^\k)}
\if{\k != 1}{
  \integer{k1 = randint(\k-1)}
  \text{ff= simplify(\c1*n^\k1)}
  \text{f = shuffle(\f, \ff)}
  \text{f = wims(replace internal , by  +  in \f)}
  \text{nk1=simplify(n^\k1)}
}
\text{na=simplify(n^\a)}
\text{nb=simplify(n^\b)}
\text{nk=simplify(n^\k)}

\text{faux =}
\text{liste = \(O(\nk)), \(O(\nk lg(n))), \(O(n^{\log_{\b} \a}))}
\text{faux = \a != \k ? \faux,\(O(\na))}
\text{faux = \b != \k ? \faux,\(O(\nb))}
\text{faux = \a != \k ? \faux,\(O(\na lg(n)))}
\text{faux = \b != \k ? \faux,\(O(\nb lg(n)))}
\text{faux = \a != \b ? \faux,\(O(n^{\log_{\a} \b}))}
\if{\k != 1}{
  \text{faux = \faux,\(O(\nk1)), \(O(\nk1 lg(n)))}
}
\text{faux = wims(nonempty items \faux)}
\text{rep = \a < \bk ? \liste[1]}
\text{rep = \a = \bk ? \liste[2]}
\text{rep = \a > \bk ? \liste[3]}
\text{jusq= jusqu',  partir de}
\text{lim = 100}
\text{rep = 1}
\statement{ NON TERMINE (fonction C_1 et C_2 non dfinie!)
On a trouv deux algorithmes \(A) et \(B) pour un mme problme. 

<ul>
 <li>Le cot de l'algorithme \(A) est \(C_1(x) = \C1). </li>
 <li>Le cot de l'algorithme \(B) est \(C_2(x) = \C2). </li>
</ul>
<p>Lequel a la meilleure complexit ? \embed{reply1}
</p>
<p>
Les instances ont une taille de \(\T). Quel algorithme allez-vous prfrer ? 
</p>
<p>
Vous  utiliserez le premier \embed{reply2}  \embed{reply3}
</p>
}
\answer{}{\comp;A,B}{type=radio}
\answer{}{\rep;\jusq}{type=mark}
\answer{}{\lim}{type=lim}
