http://wiki.math.bme.hu/history/Informatics1-2018/HW7?feed=atom&Informatics1-2018/HW7 - Laptörténet2024-03-28T16:59:14ZAz oldal laptörténete a wikibenMediaWiki 1.18.1http://wiki.math.bme.hu/index.php?title=Informatics1-2018/HW7&diff=13836&oldid=prevGaebor: /* Collatz */2018-12-08T00:18:10Z<p><span class="autocomment">Collatz</span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">←Régebbi változat</td>
<td colspan='2' style="background-color: white; color:black;">A lap 2018. december 8., 00:18-kori változata</td>
</tr><tr><td colspan="2" class="diff-lineno">15. sor:</td>
<td colspan="2" class="diff-lineno">15. sor:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div></math></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div></math></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>For example <math> 53 \<del class="diffchange diffchange-inline">leftarrow </del>160 \<del class="diffchange diffchange-inline">leftarrow </del>5 \<del class="diffchange diffchange-inline">leftarrow </del>16 \<del class="diffchange diffchange-inline">leftarrow </del>1 </math></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>For example <math> 53 \<ins class="diffchange diffchange-inline">rightarrow </ins>160 \<ins class="diffchange diffchange-inline">rightarrow </ins>5 \<ins class="diffchange diffchange-inline">rightarrow </ins>16 \<ins class="diffchange diffchange-inline">rightarrow </ins>1 </math></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== Pythagoras ==</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== Pythagoras ==</div></td></tr>
</table>Gaeborhttp://wiki.math.bme.hu/index.php?title=Informatics1-2018/HW7&diff=13835&oldid=prevGaebor: Új oldal, tartalma: „= Sage = == Derivatives == '''2 points''' Define <math>f(x)=x^3 e^{-x^2}</math> and plot <math>f, f', \ldots f^{(5)}(x)</math> on the interval <math>[-2, 2]</math>. U…”2018-12-08T00:14:57Z<p>Új oldal, tartalma: „= Sage = == Derivatives == '''2 points''' Define <math>f(x)=x^3 e^{-x^2}</math> and plot <math>f, f', \ldots f^{(5)}(x)</math> on the interval <math>[-2, 2]</math>. U…”</p>
<p><b>Új lap</b></p><div>= Sage = <br />
<br />
== Derivatives ==<br />
'''2 points'''<br />
Define <math>f(x)=x^3 e^{-x^2}</math> and plot <math>f, f', \ldots f^{(5)}(x)</math> on the interval <math>[-2, 2]</math>.<br />
Use list comprehension for calculating the derivatives and use <tt>sum()</tt> to add plots into a single picture.<br />
<br />
== Collatz ==<br />
'''2 points'''<br />
Define a function similar to Collatz: <br />
* If ''n'' is odd, let <math>g(n) = 3n+1</math><br />
* otherwise divide ''n'' by the maximum power of 2 which divides ''n''<br />
<math><br />
2^{a_1}\cdot 3^{a_2}\cdot 5^{a_3} \cdot \ldots \mapsto 3^{a_2}\cdot 5^{a_3} \cdot \ldots<br />
</math><br />
<br />
For example <math> 53 \leftarrow 160 \leftarrow 5 \leftarrow 16 \leftarrow 1 </math><br />
<br />
== Pythagoras ==<br />
'''2 points'''<br />
Find all the Pythagorean triples up to 1000. You need <math>1000\geq i>j\geq k > 0</math> where <math>j^2+k^2=i^2</math> and all integers.<br />
You cannot list the same triple twice.<br />
<br />
== Pythagoras 2 ==<br />
'''2 points'''<br />
Find all the Pythagorean triples up to 100000.<br />
Mind that three '''for''' up to 100000 would take days, so you need to generate the triples with a formula, see https://en.wikipedia.org/wiki/Pythagorean_triple#Generating_a_triple<br />
<br />
= Deadline =<br />
'''2018.12.13 Thursday 23:59'''<br />
<br />
Download the solution notebook in a .sws format and attach that.</div>Gaebor