<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[expandierte Form des Ausdrucks (a+b)^n ausgeben]]></title><description><![CDATA[<p>Hallo <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>Ich muss ein neues Bsp programmieren:</p>
<p>Schreiben Sie ein Programm, das eine natürliche Zahl n einliest und die expandierte Form des Ausdrucks (a+b)^n ausgibt. Also z.B.:</p>
<p>Eingabe: 3 Ausgabe: a<sup>3+3a</sup>2b+3ab<sup>2+b</sup>3</p>
<p>ich hätte dann einfach die zahl eingelesen und dann es so ausgegeben:</p>
<pre><code>cout &lt;&lt; &quot;a^&quot; &lt;&lt; zahl &lt;&lt; &quot;+&quot; &lt;&lt; zahl &lt;&lt; &quot;a^2b+&quot; &lt;&lt; zahl &lt;&lt; &quot;ab^2+b^&quot; &lt;&lt; zahl &lt;&lt; endl&lt;&lt; endl;
</code></pre>
<p>oder muss man die formel eingeben und das Programm muss es selbst ausgeben? geht sowas? wie würdet ihr das lösen?</p>
<p>Bin erst im 1. Semester also haben wir noch nicht allzuviel gemacht.. unser letztes Thema war &quot;Geltungsbereich und Funktionen&quot; falls das hilft</p>
<p>Würde mich sehr über eine Antwort freuen<br />
Danke <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/316174/expandierte-form-des-ausdrucks-a-b-n-ausgeben</link><generator>RSS for Node</generator><lastBuildDate>Thu, 30 Jul 2026 07:15:05 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/316174.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 24 Apr 2013 09:13:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to expandierte Form des Ausdrucks (a+b)^n ausgeben on Wed, 24 Apr 2013 09:13:38 GMT]]></title><description><![CDATA[<p>Hallo <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>Ich muss ein neues Bsp programmieren:</p>
<p>Schreiben Sie ein Programm, das eine natürliche Zahl n einliest und die expandierte Form des Ausdrucks (a+b)^n ausgibt. Also z.B.:</p>
<p>Eingabe: 3 Ausgabe: a<sup>3+3a</sup>2b+3ab<sup>2+b</sup>3</p>
<p>ich hätte dann einfach die zahl eingelesen und dann es so ausgegeben:</p>
<pre><code>cout &lt;&lt; &quot;a^&quot; &lt;&lt; zahl &lt;&lt; &quot;+&quot; &lt;&lt; zahl &lt;&lt; &quot;a^2b+&quot; &lt;&lt; zahl &lt;&lt; &quot;ab^2+b^&quot; &lt;&lt; zahl &lt;&lt; endl&lt;&lt; endl;
</code></pre>
<p>oder muss man die formel eingeben und das Programm muss es selbst ausgeben? geht sowas? wie würdet ihr das lösen?</p>
<p>Bin erst im 1. Semester also haben wir noch nicht allzuviel gemacht.. unser letztes Thema war &quot;Geltungsbereich und Funktionen&quot; falls das hilft</p>
<p>Würde mich sehr über eine Antwort freuen<br />
Danke <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2317990</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2317990</guid><dc:creator><![CDATA[christl_]]></dc:creator><pubDate>Wed, 24 Apr 2013 09:13:38 GMT</pubDate></item><item><title><![CDATA[Reply to expandierte Form des Ausdrucks (a+b)^n ausgeben on Wed, 24 Apr 2013 09:17:52 GMT]]></title><description><![CDATA[<p>da du das n nicht kennst, musst du in irgendeiner Weise eine Schleife einbauen.</p>
<p>überlege dir doch zuerst, wie die auszugebende Formel in allgemeiner Form aussehen muss.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2317992</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2317992</guid><dc:creator><![CDATA[daddy_felix]]></dc:creator><pubDate>Wed, 24 Apr 2013 09:17:52 GMT</pubDate></item><item><title><![CDATA[Reply to expandierte Form des Ausdrucks (a+b)^n ausgeben on Wed, 24 Apr 2013 09:30:14 GMT]]></title><description><![CDATA[<p>Schau mal für die Koeffizienten unter &quot;Pascalsches Dreieck&quot; oder unter &quot;Binomischer Lehrsatz&quot; (nicht &quot;Binomische Formeln).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2317997</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2317997</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Wed, 24 Apr 2013 09:30:14 GMT</pubDate></item><item><title><![CDATA[Reply to expandierte Form des Ausdrucks (a+b)^n ausgeben on Thu, 25 Apr 2013 20:35:53 GMT]]></title><description><![CDATA[<p>Allein das was bei Wikipedia steht zum Binomischen Lehrsatz ist total easy und cool, lol...</p>
<p>Muss sowas auch mal programmieren...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2318511</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2318511</guid><dc:creator><![CDATA[Skym0sh0]]></dc:creator><pubDate>Thu, 25 Apr 2013 20:35:53 GMT</pubDate></item><item><title><![CDATA[Reply to expandierte Form des Ausdrucks (a+b)^n ausgeben on Thu, 25 Apr 2013 20:45:21 GMT]]></title><description><![CDATA[<p>Sky, diemerste Summenformel,aus dem wikipedia Artikel ist doch gar nicht so schwer. Was daran ist das Problem?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2318515</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2318515</guid><dc:creator><![CDATA[Pascale]]></dc:creator><pubDate>Thu, 25 Apr 2013 20:45:21 GMT</pubDate></item><item><title><![CDATA[Reply to expandierte Form des Ausdrucks (a+b)^n ausgeben on Fri, 26 Apr 2013 16:25:08 GMT]]></title><description><![CDATA[<p>Mein Beitrag war auch keine Ironie...<br />
Ich hab in der Schule früher immer nur drüber nachgedacht, wie man eben das (a+b)^n schreiben kann, bzw wie das für verschiedene n's grösser 2 aussieht. Aber ich hab nie dazu was recherchiert oder gegoogelt.</p>
<p>Und ja, die Formel da bei wikipedia ist auch nicht schwer...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2318786</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2318786</guid><dc:creator><![CDATA[Skym0sh0]]></dc:creator><pubDate>Fri, 26 Apr 2013 16:25:08 GMT</pubDate></item><item><title><![CDATA[Reply to expandierte Form des Ausdrucks (a+b)^n ausgeben on Fri, 26 Apr 2013 18:17:22 GMT]]></title><description><![CDATA[<p>Das ist doch viel zu einfach. Rekursiv die einzelnen Koeffizienten berechnen und dann ist der Rest nur noch eine Schleife.</p>
<p>Das einzige was hier schmerzt ist die Performance, aber die Funktion kann man im Notfall auch endrekursiv machen.</p>
<pre><code>#include &lt;iostream&gt;
#include &lt;iterator&gt;

unsigned getPascalTriangleNumber( unsigned row,
                                  unsigned column )
{
    if( column == 0
     || column == row )
        return 1;

    return getPascalTriangleNumber(row - 1, column - 1 ) + getPascalTriangleNumber(row - 1, column );
}

int main()
{
    unsigned const N = *std::istream_iterator&lt;unsigned&gt;(std::cin);

    for( unsigned counter = 0; counter &lt; N + 1; ++counter )
        std::cout &lt;&lt; '\n' &lt;&lt; getPascalTriangleNumber( N, counter ) &lt;&lt; &quot; a^&quot; &lt;&lt; N-counter &lt;&lt; &quot; b^&quot; &lt;&lt; counter;
}
</code></pre>
<p><strong>Aber volkard!!</strong> Das ist noch längst nicht 1337-mäßig genug. Da geht viel mehr. Zeig was du kannst!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2318812</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2318812</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Fri, 26 Apr 2013 18:17:22 GMT</pubDate></item><item><title><![CDATA[Reply to expandierte Form des Ausdrucks (a+b)^n ausgeben on Fri, 26 Apr 2013 18:15:51 GMT]]></title><description><![CDATA[<p>Sone schrieb:</p>
<blockquote>
<p>Das einzige was hier schmerzt ist die Performance, aber die Funktion sollte man endrekursiv machen können.</p>
</blockquote>
<p>Auaaaaaaa<br />
O(n·e<sup>n</sup>), das tut echt weh. Die Performance ist schrecklich.<br />
Im Optimalfall (und ich bin mir nicht sicher, ob ich dir das zutrauen darf) kann man deinen Ansatz auf O(n<sup>2</sup>) verbessern.</p>
<p>Dabei gibt es eine so schöne O(n)-Lösung.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2318813</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2318813</guid><dc:creator><![CDATA[schmerzmittel]]></dc:creator><pubDate>Fri, 26 Apr 2013 18:15:51 GMT</pubDate></item><item><title><![CDATA[Reply to expandierte Form des Ausdrucks (a+b)^n ausgeben on Fri, 26 Apr 2013 18:16:41 GMT]]></title><description><![CDATA[<p>Sone schrieb:</p>
<blockquote>
<p><strong>Aber volkard!!</strong> Das ist noch längst nicht 1337-mäßig genug. Da geht viel mehr. Zeig was du kannst!</p>
</blockquote>
<p>Aber Sprüche reissen, das kannst du.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2318815</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2318815</guid><dc:creator><![CDATA[schmerzmittel]]></dc:creator><pubDate>Fri, 26 Apr 2013 18:16:41 GMT</pubDate></item><item><title><![CDATA[Reply to expandierte Form des Ausdrucks (a+b)^n ausgeben on Fri, 26 Apr 2013 18:34:22 GMT]]></title><description><![CDATA[<p>Ja, die Performance ist natürlich kacke, weil für jeden Koeffizient das komplette Dreieck hochgelaufen wird.<br />
Es geht schöner. Wenn man nämlich das Dreieck vorher berechnet.</p>
<p>Besser?</p>
<pre><code>#include &lt;iostream&gt;
#include &lt;iterator&gt;
#include &lt;vector&gt;
#include &lt;numeric&gt;

int main()
{
    std::vector&lt;int&gt; v = {1}, v2{1, 1};

    unsigned const N = *std::istream_iterator&lt;unsigned&gt;(std::cin);

    for( int a = 0; a &lt; N ; ++a )
    {
        v = v2;
        v2.push_back(1);
        std::adjacent_difference( v.begin(), v.end(), v2.begin(), std::plus&lt;int&gt;() );
    }

    for( unsigned counter = 0; counter &lt; N + 1; ++counter )
        std::cout &lt;&lt; '\n' &lt;&lt; v[counter] &lt;&lt; &quot; a^&quot; &lt;&lt; N-counter &lt;&lt; &quot; b^&quot; &lt;&lt; counter;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2318819</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2318819</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Fri, 26 Apr 2013 18:34:22 GMT</pubDate></item><item><title><![CDATA[Reply to expandierte Form des Ausdrucks (a+b)^n ausgeben on Fri, 26 Apr 2013 18:35:20 GMT]]></title><description><![CDATA[<p>schmerzmittel schrieb:</p>
<blockquote>
<p>Sone schrieb:</p>
<blockquote>
<p><strong>Aber volkard!!</strong> Das ist noch längst nicht 1337-mäßig genug. Da geht viel mehr. Zeig was du kannst!</p>
</blockquote>
<p>Aber Sprüche reissen, das kannst du.</p>
</blockquote>
<p>Wieso? volkard ist bekannt für seine IOCCC-reifen Wahnsinns-Dinger. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2318820</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2318820</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Fri, 26 Apr 2013 18:35:20 GMT</pubDate></item><item><title><![CDATA[Reply to expandierte Form des Ausdrucks (a+b)^n ausgeben on Fri, 26 Apr 2013 18:42:43 GMT]]></title><description><![CDATA[<p>Sone schrieb:</p>
<blockquote>
<p>schmerzmittel schrieb:</p>
<blockquote>
<p>Sone schrieb:</p>
<blockquote>
<p><strong>Aber volkard!!</strong> Das ist noch längst nicht 1337-mäßig genug. Da geht viel mehr. Zeig was du kannst!</p>
</blockquote>
<p>Aber Sprüche reissen, das kannst du.</p>
</blockquote>
<p>Wieso? volkard ist bekannt für seine IOCCC-reifen Wahnsinns-Dinger. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
</blockquote>
<p>Echt? Zeig mal ne Auswahl.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2318822</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2318822</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Fri, 26 Apr 2013 18:42:43 GMT</pubDate></item><item><title><![CDATA[Reply to expandierte Form des Ausdrucks (a+b)^n ausgeben on Fri, 26 Apr 2013 18:45:32 GMT]]></title><description><![CDATA[<p>Sone schrieb:</p>
<blockquote>
<p>Es geht schöner. Wenn man nämlich das Dreieck vorher berechnet.</p>
</blockquote>
<p>Jetzt hast du O(n<sup>2</sup>).</p>
<p>Stell dir vor, du möchtest aus einer Liste das maximale Element bestimmen.<br />
Dein Ansatz mit adjacent_difference entspricht Bubble-Sort auf die ganze Liste und am Schluss front() zurückgeben. Das ist O(n<sup>2</sup>) mit O(n) Memory.<br />
Die Musterlösung wäre eine lineare Suche. O(n) Memory und O(1) Speicher.</p>
<p>So eine Musterlösung in O(n) gibt es auch für diese Aufgabe, etwas kürzerer Code und um einiges schneller.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2318825</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2318825</guid><dc:creator><![CDATA[schmerzmittel]]></dc:creator><pubDate>Fri, 26 Apr 2013 18:45:32 GMT</pubDate></item><item><title><![CDATA[Reply to expandierte Form des Ausdrucks (a+b)^n ausgeben on Fri, 26 Apr 2013 18:51:14 GMT]]></title><description><![CDATA[<p>volkard schrieb:</p>
<blockquote>
<p>Sone schrieb:</p>
<blockquote>
<p>schmerzmittel schrieb:</p>
<blockquote>
<p>Sone schrieb:</p>
<blockquote>
<p><strong>Aber volkard!!</strong> Das ist noch längst nicht 1337-mäßig genug. Da geht viel mehr. Zeig was du kannst!</p>
</blockquote>
<p>Aber Sprüche reissen, das kannst du.</p>
</blockquote>
<p>Wieso? volkard ist bekannt für seine IOCCC-reifen Wahnsinns-Dinger. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
</blockquote>
<p>Echt? Zeig mal ne Auswahl.</p>
</blockquote>
<p>Du wahrst schon vor vielen Jahren dafür berühmt, da muss ich doch nix zeigen:<br />
<a href="http://www.c-plusplus.net/forum/35483-full" rel="nofollow">http://www.c-plusplus.net/forum/35483-full</a> (Post von Gary)</p>
<p>Da fällt mir ein, da hab ich mich noch mit Pi gestritten! Ach, waren das Zeiten.... :schwelg'-in-schönen-Erinnerungen:</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2318828</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2318828</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Fri, 26 Apr 2013 18:51:14 GMT</pubDate></item><item><title><![CDATA[Reply to expandierte Form des Ausdrucks (a+b)^n ausgeben on Fri, 26 Apr 2013 19:02:02 GMT]]></title><description><![CDATA[<p>Sone schrieb:</p>
<blockquote>
<p>Du wahrst schon vor vielen Jahren dafür berühmt, da muss ich doch nix zeigen:<br />
<a href="http://www.c-plusplus.net/forum/35483-full" rel="nofollow">http://www.c-plusplus.net/forum/35483-full</a> (Post von Gary)</p>
</blockquote>
<p>Hier ist die ursprüngliche Quelle:<br />
<a href="http://www2.fh-augsburg.de/informatik/vorlesungen/XX/c_cplus/tutorial/henkel/else_if__Loesungsvorschlag.html" rel="nofollow">http://www2.fh-augsburg.de/informatik/vorlesungen/XX/c_cplus/tutorial/henkel/else_if__Loesungsvorschlag.html</a><br />
Beachte den letzten Satz.<br />
Ja, zum Spaß kann ich auch mal absichtlich unleserlich schreiben.</p>
<p>Hab's übrigens gerade in O(n) hinbekommen. Da hätte ich aber nicht daran gedacht, wenn schmerzmittel nicht gesagt hätte, daß es geht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2318832</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2318832</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Fri, 26 Apr 2013 19:02:02 GMT</pubDate></item><item><title><![CDATA[Reply to expandierte Form des Ausdrucks (a+b)^n ausgeben on Fri, 26 Apr 2013 19:33:42 GMT]]></title><description><![CDATA[<p>volkard schrieb:</p>
<blockquote>
<p>Hab's übrigens gerade in O(n) hinbekommen. Da hätte ich aber nicht daran gedacht, wenn schmerzmittel nicht gesagt hätte, daß es geht.</p>
</blockquote>
<p>Hmm? Übersehe ich was oder sollte das nicht ziemlich einfach gehen?</p>
<pre><code class="language-cpp">int coefficient = 1;
for(int i = 0; i &lt;= n; ++i)
{
	cout &lt;&lt; coefficient &lt;&lt; &quot; &quot;;
	coefficient *= n - i;
	coefficient /= i + 1;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2318844</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2318844</guid><dc:creator><![CDATA[Michael E.]]></dc:creator><pubDate>Fri, 26 Apr 2013 19:33:42 GMT</pubDate></item><item><title><![CDATA[Reply to expandierte Form des Ausdrucks (a+b)^n ausgeben on Fri, 26 Apr 2013 19:36:23 GMT]]></title><description><![CDATA[<p>Michael E. schrieb:</p>
<blockquote>
<p>volkard schrieb:</p>
<blockquote>
<p>Hab's übrigens gerade in O(n) hinbekommen. Da hätte ich aber nicht daran gedacht, wenn schmerzmittel nicht gesagt hätte, daß es geht.</p>
</blockquote>
<p>Hmm? Übersehe ich was oder sollte das nicht ziemlich einfach gehen?</p>
</blockquote>
<p>Du hast nichts übersehen. Ich sage ja nicht, daß es schwierig war. Aber es sprang mir nicht von allein ins Auge.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2318845</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2318845</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Fri, 26 Apr 2013 19:36:23 GMT</pubDate></item><item><title><![CDATA[Reply to expandierte Form des Ausdrucks (a+b)^n ausgeben on Fri, 26 Apr 2013 19:57:36 GMT]]></title><description><![CDATA[<p>Ich hab hier grad eine Viertelstunde im Wahnsinn gesucht und geformelt, dann bin ich auf ein Muster gestoßen:</p>
<pre><code>#include &lt;iostream&gt;
#include &lt;iterator&gt;
#include &lt;vector&gt;
#include &lt;numeric&gt;

int main()
{
    unsigned const N = *std::istream_iterator&lt;unsigned&gt;(std::cin);

    std::vector&lt;int&gt; v( N + 1 );
    v[0] = 1;

    int const half = (N + 2) / 2;

    for( int a = 1; a &lt; N + 1 ; ++a )
        v[a] = v[a - 1] * (N - a + 1) / a;

    for( unsigned counter = 0; counter &lt; N + 1; ++counter )
        std::cout &lt;&lt; '\n' &lt;&lt; v[counter] &lt;&lt; &quot; a^&quot; &lt;&lt; N-counter &lt;&lt; &quot; b^&quot; &lt;&lt; counter;
}
</code></pre>
<p>Man beachte die Zeile 16...<br />
Edit: Falsche Zeile.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2318847</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2318847</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Fri, 26 Apr 2013 19:57:36 GMT</pubDate></item><item><title><![CDATA[Reply to expandierte Form des Ausdrucks (a+b)^n ausgeben on Fri, 26 Apr 2013 19:47:04 GMT]]></title><description><![CDATA[<p>Für Michael ist es ein Kinderspiel! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /> Wie doof muss ich erst sein?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2318849</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2318849</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Fri, 26 Apr 2013 19:47:04 GMT</pubDate></item><item><title><![CDATA[Reply to expandierte Form des Ausdrucks (a+b)^n ausgeben on Fri, 26 Apr 2013 20:04:45 GMT]]></title><description><![CDATA[<p>Das Muster:</p>
<p>Sei die Reihe <em>V</em> die in dem Pascalschen Dreieck in der Reihe <em>n</em> stehende Reihe, und die Spalte in der wir uns befinden <em>a</em>, dann lässt sich die Reihe wie folgt erzeugen:</p>
<p><span class="katex"><span class="katex-mathml"><math><semantics><mrow><msub><mi>V</mi><mn>0</mn></msub><mtext> </mtext><mo>=</mo><mtext> </mtext><mn>1</mn></mrow><annotation encoding="application/x-tex">V_0 ~=~ 1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="strut" style="height:0.68333em;"></span><span class="strut bottom" style="height:0.83333em;vertical-align:-0.15em;"></span><span class="base textstyle uncramped"><span class="mord"><span class="mord mathit" style="margin-right:0.22222em;">V</span><span class="vlist"><span style="top:0.15em;margin-right:0.05em;margin-left:-0.22222em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span><span class="reset-textstyle scriptstyle cramped"><span class="mord mathrm">0</span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span>​</span></span></span><span class="mord mspace"> </span><span class="mrel">=</span><span class="mord mspace"> </span><span class="mord mathrm">1</span></span></span></span><br />
<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>V</mi><mi mathvariant="normal">_</mi><mi>a</mi><mtext> </mtext><mo>=</mo><mtext> </mtext><mi>V</mi><mi mathvariant="normal">_</mi><mrow><mi>a</mi><mo>−</mo><mn>1</mn></mrow><mo>∗</mo><mfrac><mrow><mi>n</mi><mo>−</mo><mi>a</mi><mo>+</mo><mn>1</mn></mrow><mrow><mi>a</mi></mrow></mfrac></mrow><annotation encoding="application/x-tex">V\_a ~=~ V\_{a - 1} * \frac{n - a + 1}{a}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="strut" style="height:0.845108em;"></span><span class="strut bottom" style="height:1.190108em;vertical-align:-0.345em;"></span><span class="base textstyle uncramped"><span class="mord mathit" style="margin-right:0.22222em;">V</span><span class="mord mathrm" style="margin-right:0.02778em;">_</span><span class="mord mathit">a</span><span class="mord mspace"> </span><span class="mrel">=</span><span class="mord mspace"> </span><span class="mord mathit" style="margin-right:0.22222em;">V</span><span class="mord mathrm" style="margin-right:0.02778em;">_</span><span class="mord textstyle uncramped"><span class="mord mathit">a</span><span class="mbin">−</span><span class="mord mathrm">1</span></span><span class="mbin">∗</span><span class="mord reset-textstyle textstyle uncramped"><span class="sizing reset-size5 size5 reset-textstyle textstyle uncramped nulldelimiter"></span><span class="mfrac"><span class="vlist"><span style="top:0.345em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span><span class="reset-textstyle scriptstyle cramped"><span class="mord scriptstyle cramped"><span class="mord mathit">a</span></span></span></span><span style="top:-0.22999999999999998em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span><span class="reset-textstyle textstyle uncramped frac-line"></span></span><span style="top:-0.394em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span><span class="reset-textstyle scriptstyle uncramped"><span class="mord scriptstyle uncramped"><span class="mord mathit">n</span><span class="mbin">−</span><span class="mord mathit">a</span><span class="mbin">+</span><span class="mord mathrm">1</span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span>​</span></span></span><span class="sizing reset-size5 size5 reset-textstyle textstyle uncramped nulldelimiter"></span></span></span></span></span></p>
<p>Wenn wir davon ausgehen, dass die erste Zeile/Spalte/Reihe Index 0 hat.</p>
<blockquote>
<p>Ja, zum Spaß kann ich auch mal absichtlich unleserlich schreiben.</p>
</blockquote>
<p>Also hatte ich Recht. Du kleiner Schlawiner. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2318855</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2318855</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Fri, 26 Apr 2013 20:04:45 GMT</pubDate></item><item><title><![CDATA[Reply to expandierte Form des Ausdrucks (a+b)^n ausgeben on Fri, 26 Apr 2013 19:57:22 GMT]]></title><description><![CDATA[<p>Sone schrieb:</p>
<blockquote>
<p>Für Michael ist es ein Kinderspiel! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /> Wie doof muss ich erst sein?</p>
</blockquote>
<p>Das hat nichts mit Doofsein zu tun, sondern mit Übung mit den Binomialkoeffizienten. Das können nämlich ganz schön biestige Viecher sein. Naja, hier willst du <span class="katex"><span class="katex-mathml"><math><semantics><mrow><mrow><mo fence="true">(</mo><mfrac linethickness="0px"><mrow><mi>n</mi></mrow><mrow><mn>0</mn></mrow></mfrac><mo fence="true">)</mo></mrow><mo separator="true">,</mo><mo>…</mo><mo separator="true">,</mo><mrow><mo fence="true">(</mo><mfrac linethickness="0px"><mrow><mi>n</mi></mrow><mrow><mi>n</mi></mrow></mfrac><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\binom{n}{0},\ldots,\binom{n}{n}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="strut" style="height:0.85em;"></span><span class="strut bottom" style="height:1.20001em;vertical-align:-0.35001em;"></span><span class="base textstyle uncramped"><span class="mord reset-textstyle textstyle uncramped"><span class="style-wrap reset-textstyle textstyle uncramped" style="top:0em;"><span class="delimsizing size1">(</span></span><span class="mfrac"><span class="vlist"><span style="top:0.345em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span><span class="reset-textstyle scriptstyle cramped"><span class="mord scriptstyle cramped"><span class="mord mathrm">0</span></span></span></span><span style="top:-0.44399999999999995em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span><span class="reset-textstyle scriptstyle uncramped"><span class="mord scriptstyle uncramped"><span class="mord mathit">n</span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span>​</span></span></span><span class="style-wrap reset-textstyle textstyle uncramped" style="top:0em;"><span class="delimsizing size1">)</span></span></span><span class="mpunct">,</span><span class="minner">…</span><span class="mpunct">,</span><span class="mord reset-textstyle textstyle uncramped"><span class="style-wrap reset-textstyle textstyle uncramped" style="top:0em;"><span class="delimsizing size1">(</span></span><span class="mfrac"><span class="vlist"><span style="top:0.345em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span><span class="reset-textstyle scriptstyle cramped"><span class="mord scriptstyle cramped"><span class="mord mathit">n</span></span></span></span><span style="top:-0.44399999999999995em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span><span class="reset-textstyle scriptstyle uncramped"><span class="mord scriptstyle uncramped"><span class="mord mathit">n</span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span>​</span></span></span><span class="style-wrap reset-textstyle textstyle uncramped" style="top:0em;"><span class="delimsizing size1">)</span></span></span></span></span></span> ausgeben. Der erste Term ist 1 und jeden weiteren erhälst du durch Einsetzen der Definition: <span class="katex"><span class="katex-mathml"><math><semantics><mrow><mrow><mo fence="true">(</mo><mfrac linethickness="0px"><mrow><mi>n</mi></mrow><mrow><mi>k</mi><mo>+</mo><mn>1</mn></mrow></mfrac><mo fence="true">)</mo></mrow><mo>=</mo><mfrac><mrow><mi>n</mi><mo>!</mo></mrow><mrow><mo>(</mo><mi>k</mi><mo>+</mo><mn>1</mn><mo>)</mo><mo>!</mo><mo>(</mo><mi>n</mi><mo>−</mo><mi>k</mi><mo>−</mo><mn>1</mn><mo>)</mo><mo>!</mo></mrow></mfrac><mo>=</mo><mfrac><mrow><mi>n</mi><mo>!</mo></mrow><mrow><mi>k</mi><mo>!</mo><mo>(</mo><mi>n</mi><mo>−</mo><mi>k</mi><mo>)</mo><mo>!</mo></mrow></mfrac><mo>⋅</mo><mfrac><mrow><mi>n</mi><mo>−</mo><mi>k</mi></mrow><mrow><mi>k</mi><mo>+</mo><mn>1</mn></mrow></mfrac><mo>=</mo><mrow><mo fence="true">(</mo><mfrac linethickness="0px"><mrow><mi>n</mi></mrow><mrow><mi>k</mi></mrow></mfrac><mo fence="true">)</mo></mrow><mfrac><mrow><mi>n</mi><mo>−</mo><mi>k</mi></mrow><mrow><mi>k</mi><mo>+</mo><mn>1</mn></mrow></mfrac></mrow><annotation encoding="application/x-tex">\binom{n}{k+1} = \frac{n!}{(k+1)!(n-k-1)!} = \frac{n!}{k!(n-k)!}\cdot\frac{n-k}{k+1} = \binom{n}{k}\frac{n-k}{k+1}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="strut" style="height:0.8801079999999999em;"></span><span class="strut bottom" style="height:1.400108em;vertical-align:-0.52em;"></span><span class="base textstyle uncramped"><span class="mord reset-textstyle textstyle uncramped"><span class="style-wrap reset-textstyle textstyle uncramped" style="top:0em;"><span class="delimsizing size1">(</span></span><span class="mfrac"><span class="vlist"><span style="top:0.345em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span><span class="reset-textstyle scriptstyle cramped"><span class="mord scriptstyle cramped"><span class="mord mathit" style="margin-right:0.03148em;">k</span><span class="mbin">+</span><span class="mord mathrm">1</span></span></span></span><span style="top:-0.44400000000000006em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span><span class="reset-textstyle scriptstyle uncramped"><span class="mord scriptstyle uncramped"><span class="mord mathit">n</span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span>​</span></span></span><span class="style-wrap reset-textstyle textstyle uncramped" style="top:0em;"><span class="delimsizing size1">)</span></span></span><span class="mrel">=</span><span class="mord reset-textstyle textstyle uncramped"><span class="sizing reset-size5 size5 reset-textstyle textstyle uncramped nulldelimiter"></span><span class="mfrac"><span class="vlist"><span style="top:0.34500000000000003em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span><span class="reset-textstyle scriptstyle cramped"><span class="mord scriptstyle cramped"><span class="mopen">(</span><span class="mord mathit" style="margin-right:0.03148em;">k</span><span class="mbin">+</span><span class="mord mathrm">1</span><span class="mclose">)</span><span class="mclose">!</span><span class="mopen">(</span><span class="mord mathit">n</span><span class="mbin">−</span><span class="mord mathit" style="margin-right:0.03148em;">k</span><span class="mbin">−</span><span class="mord mathrm">1</span><span class="mclose">)</span><span class="mclose">!</span></span></span></span><span style="top:-0.22999999999999998em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span><span class="reset-textstyle textstyle uncramped frac-line"></span></span><span style="top:-0.394em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span><span class="reset-textstyle scriptstyle uncramped"><span class="mord scriptstyle uncramped"><span class="mord mathit">n</span><span class="mclose">!</span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span>​</span></span></span><span class="sizing reset-size5 size5 reset-textstyle textstyle uncramped nulldelimiter"></span></span><span class="mrel">=</span><span class="mord reset-textstyle textstyle uncramped"><span class="sizing reset-size5 size5 reset-textstyle textstyle uncramped nulldelimiter"></span><span class="mfrac"><span class="vlist"><span style="top:0.34500000000000003em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span><span class="reset-textstyle scriptstyle cramped"><span class="mord scriptstyle cramped"><span class="mord mathit" style="margin-right:0.03148em;">k</span><span class="mclose">!</span><span class="mopen">(</span><span class="mord mathit">n</span><span class="mbin">−</span><span class="mord mathit" style="margin-right:0.03148em;">k</span><span class="mclose">)</span><span class="mclose">!</span></span></span></span><span style="top:-0.22999999999999998em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span><span class="reset-textstyle textstyle uncramped frac-line"></span></span><span style="top:-0.394em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span><span class="reset-textstyle scriptstyle uncramped"><span class="mord scriptstyle uncramped"><span class="mord mathit">n</span><span class="mclose">!</span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span>​</span></span></span><span class="sizing reset-size5 size5 reset-textstyle textstyle uncramped nulldelimiter"></span></span><span class="mbin">⋅</span><span class="mord reset-textstyle textstyle uncramped"><span class="sizing reset-size5 size5 reset-textstyle textstyle uncramped nulldelimiter"></span><span class="mfrac"><span class="vlist"><span style="top:0.345em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span><span class="reset-textstyle scriptstyle cramped"><span class="mord scriptstyle cramped"><span class="mord mathit" style="margin-right:0.03148em;">k</span><span class="mbin">+</span><span class="mord mathrm">1</span></span></span></span><span style="top:-0.22999999999999998em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span><span class="reset-textstyle textstyle uncramped frac-line"></span></span><span style="top:-0.394em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span><span class="reset-textstyle scriptstyle uncramped"><span class="mord scriptstyle uncramped"><span class="mord mathit">n</span><span class="mbin">−</span><span class="mord mathit" style="margin-right:0.03148em;">k</span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span>​</span></span></span><span class="sizing reset-size5 size5 reset-textstyle textstyle uncramped nulldelimiter"></span></span><span class="mrel">=</span><span class="mord reset-textstyle textstyle uncramped"><span class="style-wrap reset-textstyle textstyle uncramped" style="top:0em;"><span class="delimsizing size1">(</span></span><span class="mfrac"><span class="vlist"><span style="top:0.345em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span><span class="reset-textstyle scriptstyle cramped"><span class="mord scriptstyle cramped"><span class="mord mathit" style="margin-right:0.03148em;">k</span></span></span></span><span style="top:-0.44399999999999995em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span><span class="reset-textstyle scriptstyle uncramped"><span class="mord scriptstyle uncramped"><span class="mord mathit">n</span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span>​</span></span></span><span class="style-wrap reset-textstyle textstyle uncramped" style="top:0em;"><span class="delimsizing size1">)</span></span></span><span class="mord reset-textstyle textstyle uncramped"><span class="sizing reset-size5 size5 reset-textstyle textstyle uncramped nulldelimiter"></span><span class="mfrac"><span class="vlist"><span style="top:0.345em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span><span class="reset-textstyle scriptstyle cramped"><span class="mord scriptstyle cramped"><span class="mord mathit" style="margin-right:0.03148em;">k</span><span class="mbin">+</span><span class="mord mathrm">1</span></span></span></span><span style="top:-0.22999999999999998em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span><span class="reset-textstyle textstyle uncramped frac-line"></span></span><span style="top:-0.394em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span><span class="reset-textstyle scriptstyle uncramped"><span class="mord scriptstyle uncramped"><span class="mord mathit">n</span><span class="mbin">−</span><span class="mord mathit" style="margin-right:0.03148em;">k</span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span>​</span></span></span><span class="sizing reset-size5 size5 reset-textstyle textstyle uncramped nulldelimiter"></span></span></span></span></span>.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2318856</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2318856</guid><dc:creator><![CDATA[Michael E.]]></dc:creator><pubDate>Fri, 26 Apr 2013 19:57:22 GMT</pubDate></item><item><title><![CDATA[Reply to expandierte Form des Ausdrucks (a+b)^n ausgeben on Fri, 26 Apr 2013 20:00:05 GMT]]></title><description><![CDATA[<p>Michael E. schrieb:</p>
<blockquote>
<p><span class="katex"><span class="katex-mathml"><math><semantics><mrow><mrow><mo fence="true">(</mo><mfrac linethickness="0px"><mrow><mi>n</mi></mrow><mrow><mi>k</mi><mo>+</mo><mn>1</mn></mrow></mfrac><mo fence="true">)</mo></mrow><mo>=</mo><mrow><mo fence="true">(</mo><mfrac linethickness="0px"><mrow><mi>n</mi></mrow><mrow><mi>k</mi></mrow></mfrac><mo fence="true">)</mo></mrow><mfrac><mrow><mi>n</mi><mo>−</mo><mi>k</mi></mrow><mrow><mi>k</mi><mo>+</mo><mn>1</mn></mrow></mfrac></mrow><annotation encoding="application/x-tex">\binom{n}{k+1} = \binom{n}{k}\frac{n-k}{k+1}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="strut" style="height:0.8801079999999999em;"></span><span class="strut bottom" style="height:1.283439em;vertical-align:-0.403331em;"></span><span class="base textstyle uncramped"><span class="mord reset-textstyle textstyle uncramped"><span class="style-wrap reset-textstyle textstyle uncramped" style="top:0em;"><span class="delimsizing size1">(</span></span><span class="mfrac"><span class="vlist"><span style="top:0.345em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span><span class="reset-textstyle scriptstyle cramped"><span class="mord scriptstyle cramped"><span class="mord mathit" style="margin-right:0.03148em;">k</span><span class="mbin">+</span><span class="mord mathrm">1</span></span></span></span><span style="top:-0.44400000000000006em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span><span class="reset-textstyle scriptstyle uncramped"><span class="mord scriptstyle uncramped"><span class="mord mathit">n</span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span>​</span></span></span><span class="style-wrap reset-textstyle textstyle uncramped" style="top:0em;"><span class="delimsizing size1">)</span></span></span><span class="mrel">=</span><span class="mord reset-textstyle textstyle uncramped"><span class="style-wrap reset-textstyle textstyle uncramped" style="top:0em;"><span class="delimsizing size1">(</span></span><span class="mfrac"><span class="vlist"><span style="top:0.345em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span><span class="reset-textstyle scriptstyle cramped"><span class="mord scriptstyle cramped"><span class="mord mathit" style="margin-right:0.03148em;">k</span></span></span></span><span style="top:-0.44399999999999995em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span><span class="reset-textstyle scriptstyle uncramped"><span class="mord scriptstyle uncramped"><span class="mord mathit">n</span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span>​</span></span></span><span class="style-wrap reset-textstyle textstyle uncramped" style="top:0em;"><span class="delimsizing size1">)</span></span></span><span class="mord reset-textstyle textstyle uncramped"><span class="sizing reset-size5 size5 reset-textstyle textstyle uncramped nulldelimiter"></span><span class="mfrac"><span class="vlist"><span style="top:0.345em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span><span class="reset-textstyle scriptstyle cramped"><span class="mord scriptstyle cramped"><span class="mord mathit" style="margin-right:0.03148em;">k</span><span class="mbin">+</span><span class="mord mathrm">1</span></span></span></span><span style="top:-0.22999999999999998em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span><span class="reset-textstyle textstyle uncramped frac-line"></span></span><span style="top:-0.394em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span><span class="reset-textstyle scriptstyle uncramped"><span class="mord scriptstyle uncramped"><span class="mord mathit">n</span><span class="mbin">−</span><span class="mord mathit" style="margin-right:0.03148em;">k</span></span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span>​</span></span></span><span class="sizing reset-size5 size5 reset-textstyle textstyle uncramped nulldelimiter"></span></span></span></span></span>.</p>
</blockquote>
<p>Prinzipiell was ich &quot;entdeckt&quot; hab, oder?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2318858</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2318858</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Fri, 26 Apr 2013 20:00:05 GMT</pubDate></item><item><title><![CDATA[Reply to expandierte Form des Ausdrucks (a+b)^n ausgeben on Fri, 26 Apr 2013 20:00:03 GMT]]></title><description><![CDATA[<p>Ja, wenn man a := k+1 setzt, steht da dasselbe.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2318859</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2318859</guid><dc:creator><![CDATA[Michael E.]]></dc:creator><pubDate>Fri, 26 Apr 2013 20:00:03 GMT</pubDate></item><item><title><![CDATA[Reply to expandierte Form des Ausdrucks (a+b)^n ausgeben on Fri, 26 Apr 2013 20:04:20 GMT]]></title><description><![CDATA[<p>Und was ist jetzt die Laufzeitklasse meiner letzten Version? Ist das schon O(n)?<br />
Edit: Müsste es sein.. ist prinzipiell nur eine Schleife mit N Durchläufen.</p>
<p>Da fällt mir auf, µ hätte mir, wie war das, &quot;auf die Finger geschlagen&quot;, wenn ich über Laufzeitklassen rede... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2318865</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2318865</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Fri, 26 Apr 2013 20:04:20 GMT</pubDate></item><item><title><![CDATA[Reply to expandierte Form des Ausdrucks (a+b)^n ausgeben on Fri, 26 Apr 2013 20:34:14 GMT]]></title><description><![CDATA[<p>Sone schrieb:</p>
<blockquote>
<p>Und was ist jetzt die Laufzeitklasse meiner letzten Version? Ist das schon O(n)?<br />
Edit: Müsste es sein.. ist prinzipiell nur eine Schleife mit N Durchläufen.</p>
</blockquote>
<p>Du hast es verstanden. Es sind 2 Schleifen mit N und N+1 Durchläufen, also insgesamt O(n+(n+1)+c) bzw. O(n).</p>
<p>Vollständiger Code:</p>
<pre><code class="language-cpp">std::cout &lt;&lt; &quot;1*a^0*b^&quot; &lt;&lt; n;
for (int i=1, c=n; i&lt;=n; c*=n-i,c/=++i)
  std::cout &lt;&lt; &quot; + &quot; &lt;&lt; c &lt;&lt; &quot;*a^&quot;&lt;&lt; n-i &lt;&lt; &quot;*b^&quot; &lt;&lt; i;
std::cout &lt;&lt; '\n';
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2318876</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2318876</guid><dc:creator><![CDATA[schmerzmittel]]></dc:creator><pubDate>Fri, 26 Apr 2013 20:34:14 GMT</pubDate></item><item><title><![CDATA[Reply to expandierte Form des Ausdrucks (a+b)^n ausgeben on Fri, 26 Apr 2013 21:28:27 GMT]]></title><description><![CDATA[<p>Ach klar, man kann natürlich auch ohne Pufferung machen... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2318882</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2318882</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Fri, 26 Apr 2013 21:28:27 GMT</pubDate></item></channel></rss>