11.07.2015 Views

Correction TD1.pdf - Les CPGE de Loritz

Correction TD1.pdf - Les CPGE de Loritz

Correction TD1.pdf - Les CPGE de Loritz

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Correction</strong> TD1.nb 8In[101]:=G17, 205040302010Out[101]= Graphics 5 10 15 20 Une métho<strong>de</strong> plus élégante :Plutot que <strong>de</strong> calculer et recalculer plusieurs fois les termes, on peut les memoriser, ou meme construire la liste <strong>de</strong>s termesconsecutifs :In[103]:=Fn_ :⩵ Whichn 1, 1, EvenQn, n 2, OddQn, 3n 1In[121]:=H<strong>de</strong>part_, iter_ :⩵L ⩵ <strong>de</strong>part; Fori ⩵ 0, i iter, i, L ⩵ L . y___, x_ y, x, Fx; LIn[123]:=H17, 20Out[123]=17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1La métho<strong>de</strong> : on part d’une liste avec le premier élément et par itération, on remplace la liste par elle−meme plus l’image du<strong>de</strong>rnier élément.In[128]:=ListPlotH117, 30, PlotJoined True10080604020Out[128]= Graphics 5 10 15 20 25 30La conjecture <strong>de</strong> Syracuse est que quel que soit le terme initial la suite <strong>de</strong>vient stationnaire, égale à 1.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!