Mathematics https://tech.feedyourhead.at/tags/mathematics en Happy PI Day: This year it is a much more special day https://tech.feedyourhead.at/content/happy-pi-day-year-it-much-more-special-day <span class="field field--name-title field--type-string field--label-hidden">Happy PI Day: This year it is a much more special day</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p><a href="http://xkcd.com/10/"><img alt="" src="http://imgs.xkcd.com/comics/pi.jpg" style="height:247px; width:469px" /></a></p> <p><a href="http://en.wikipedia.org/wiki/Pi_Day">PI-Day</a> is an unofficial day for celebrating the mathematical constant PI. The date for this day is certainly on March 14: 3.14(the first 3 significant digits of PI. But this year it is even much more special because we have 3. 14, 2015, 09:26:53 which are the first 10 digits of PI. So we can celebrate PI much more precisely <img alt="wink" src="http://tech.feedyourhead.at/sites/all/libraries/ckeditor/plugins/smiley/images/wink_smile.png" style="height:23px; width:23px" title="wink" /></p> <p>&nbsp;</p> <p>So what can we do on this awesome date? I will go to the <a href="http://thepiefactory.at/">PI(E)-Factory</a> and will eat an <a href="http://thepiefactory.at/gallery/Pikante%20Pies/Chicken%20Deluxe%20and%20G%27standener%20on%20plates.jpg">Apple PI(E)</a>. After that i will play a bit with my very new <a href="http://www.raspberrypi.org/">Raspberry PI 2</a></p> <p>Hm, maybe I will also <a href="http://www.wikihow.com/Calculate-Pi">manually calculate PI</a> until I found my <a href="http://www.facade.com/legacy/amiinpi/">birthday date in PI </a>or until it's late.</p> </div> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/users/hoti" typeof="schema:Person" property="schema:name" datatype="">Hoti</span></span> <span class="field field--name-created field--type-created field--label-hidden">Mar 14 2015</span> <div class="field field--name-field-tagies field--type-entity-reference field--label-above"> <div class="field__label">Tags</div> <div class='field__items'> <div class="field__item"><i class="fa fa-tags"></i> <a href="/Fun" hreflang="en">Fun</a></div> <div class="field__item"><i class="fa fa-tags"></i> <a href="/tags/mathematics" hreflang="en">Mathematics</a></div> </div> </div> <section class="field field--name-comment-node-blog field--type-comment field--label-hidden comment-wrapper"> </section> <section class="field field--name-comment field--type-comment field--label-above comment-wrapper"> <h2 class='title comment-form__title'> <i class="fa fa-comments-o"></i> Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=64&amp;2=comment&amp;3=comment" token="M_QFmT1OqU4bEU_bRDOh6PlOlCNXhkhzRNYo8Y0GqcQ"></drupal-render-placeholder> </section> Sat, 14 Mar 2015 09:51:46 +0000 Hoti 64 at https://tech.feedyourhead.at First steps with GNU Octave (2) - Solving Equations https://tech.feedyourhead.at/content/first-steps-gnu-octave-2-solving-equations <span class="field field--name-title field--type-string field--label-hidden">First steps with GNU Octave (2) - Solving Equations </span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><h1>Solving Simple Linear Equations</h1> <p>We can solve linear equations using vectors:</p> <pre> <code lang="matlab"> 3x - 1y = 3 1x + 1y = 5 x = 2 y = 3 </code></pre> <pre> <code lang="matlab"> octave:4&gt; ################################### octave:4&gt; # solving linear equations octave:4&gt; # 3x - 1y = 3 octave:4&gt; # 1x + 1y = 5 octave:4&gt; A=[3 -1; 1 1]; octave:5&gt; b=[3;5]; octave:6&gt; A\b ans = 2 3 </code></pre> <h1>Solving Polynomial Equations</h1> <pre> <code lang="matlab">4x<sup>2</sup> - 12y - 40 = 0 x1 = 5 x2 = -2 </code></pre> <pre> <code lang="matlab"> octave:1&gt; # finding the roots of a polynomial octave:1&gt; k = [4, -12, -40] k = 4 -12 -40 octave:2&gt;# octave:2&gt; # output: octave:2&gt; polyout(k,'x') 4*x^2 - 12*x^1 - 40 octave:3&gt; octave:3&gt; # solving: octave:3&gt; roots(k) ans = 5 -2 </code></pre> </div> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/users/hoti" typeof="schema:Person" property="schema:name" datatype="">Hoti</span></span> <span class="field field--name-created field--type-created field--label-hidden">Feb 08 2015</span> <div class="field field--name-field-tagies field--type-entity-reference field--label-above"> <div class="field__label">Tags</div> <div class='field__items'> <div class="field__item"><i class="fa fa-tags"></i> <a href="/tags/mathematics" hreflang="en">Mathematics</a></div> <div class="field__item"><i class="fa fa-tags"></i> <a href="/tags/octave" hreflang="en">Octave</a></div> </div> </div> <section class="field field--name-comment-node-blog field--type-comment field--label-hidden comment-wrapper"> </section> <section class="field field--name-comment field--type-comment field--label-above comment-wrapper"> <h2 class='title comment-form__title'> <i class="fa fa-comments-o"></i> Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=50&amp;2=comment&amp;3=comment" token="8WGO8ImBirMqhXncJ2JSiB-Mre32O1REXwH0equKyUQ"></drupal-render-placeholder> </section> Sun, 08 Feb 2015 18:23:12 +0000 Hoti 50 at https://tech.feedyourhead.at First steps with GNU Octave (1) - Modulo-Fun https://tech.feedyourhead.at/content/first-steps-gnu-octave-1-modulo-fun <span class="field field--name-title field--type-string field--label-hidden">First steps with GNU Octave (1) - Modulo-Fun </span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>GNU Octave is some kind of programming language for mathematical use cases. It's mostly compatible with MATLAB and it's Open-Source.</p> <p>I just started to get familiar with GNU Octave and i really like it.&nbsp; Here i record my "first steps" and post my scripts..</p> <p><strong>Print out multiplication -and additiontable:</strong></p> <pre> <code lang="matlab"> #!/usr/bin/octave -qf function modtable (m) printf("+ "); for i = 0:m-1 printf("%0.2d ",i) endfor printf("\n",i) for i = 0:m-1 printf("%0.2d|",i); for j = 0:m-1 g = mod( (j+i),m); if( (j+i) &lt; m ) printf("%0.2d ",j+i); else printf("%0.2d ",g); endif endfor printf("\n"); endfor printf("\n"); printf("* "); for i = 0:m-1 printf("%0.2d ",i) endfor printf("\n"); for i = 0:m-1 printf("%0.2d|",i); for j = 0:m-1 g = mod( (j*i),m); if( (j*i) &lt; m ) printf("%0.2d ",j*i); else printf("%0.2d ",g); endif endfor printf("\n"); endfor endfunction if(nargin != 1) printf("usage: %s \n",program_name()); exit(); endif arg_list = argv(); modtable(str2num(arg_list{1})) </code></pre> <p><strong>Fun with recursion(calculating gcd with euklid):</strong></p> <pre> <code lang="matlab"> #!/usr/bin/octave -qf function retval = gcd_euklid(a,b) retval = 0; retmod = mod(a,b); retdiv = a/b; if(retmod != 0) retval = gcd_euklid(b,retmod); else retval = b; return; endif endfunction if(nargin != 2) printf("usage: %s \n",program_name()); exit(); endif arg_list = argv(); printf("%d \n",gcd_euklid(str2num(arg_list{1}),str2num(arg_list{2}))); </code></pre> <p><strong>rot13-algorithm:</strong></p> <pre> <code lang="matlab"> #!/usr/bin/octave -qf function retval = getcharnumber (char) alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXY"; for i=1:length(alphabet) if( alphabet(i) == char) retval = i; return; endif endfor retval = -1; return; endfunction function rot13 (m) alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXY"; for i=1:length(m) printf("%c",alphabet(mod(getcharnumber(m(i))+13,26))) endfor printf("\n"); endfunction if(nargin != 1) printf("usage: %s \n",program_name()); exit(); endif arg_list = argv(); rot13(toupper(arg_list{1})) </code></pre> </div> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/users/hoti" typeof="schema:Person" property="schema:name" datatype="">Hoti</span></span> <span class="field field--name-created field--type-created field--label-hidden">Nov 11 2014</span> <div class="field field--name-field-tagies field--type-entity-reference field--label-above"> <div class="field__label">Tags</div> <div class='field__items'> <div class="field__item"><i class="fa fa-tags"></i> <a href="/tags/mathematics" hreflang="en">Mathematics</a></div> <div class="field__item"><i class="fa fa-tags"></i> <a href="/tags/octave" hreflang="en">Octave</a></div> </div> </div> <section class="field field--name-comment-node-blog field--type-comment field--label-hidden comment-wrapper"> </section> <section class="field field--name-comment field--type-comment field--label-above comment-wrapper"> <h2 class='title comment-form__title'> <i class="fa fa-comments-o"></i> Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=9&amp;2=comment&amp;3=comment" token="1g0_Z49MsJ1d2YR9jPRW7ku1mahA70BrmRzz7aT_CCI"></drupal-render-placeholder> </section> Tue, 11 Nov 2014 10:56:22 +0000 Hoti 9 at https://tech.feedyourhead.at Mathematic model describes the "hippster-effect" https://tech.feedyourhead.at/content/mathematic-model-describes-hippster-effect <span class="field field--name-title field--type-string field--label-hidden">Mathematic model describes the &quot;hippster-effect&quot; </span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><blockquote> <p>"Hipsters avoid labels and being labeled. However, they all dress the same and act the same and conform in their non-conformity. Doesn't the fact that there is a hipster look go against all hipster beliefs?".&nbsp;</p> </blockquote> <p><a href="http://arxiv.org/pdf/1410.8001v1.pdf">Jonathan Touboul wrote this mathematic model which describes the "hippster-effect"</a></p> </div> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/users/hoti" typeof="schema:Person" property="schema:name" datatype="">Hoti</span></span> <span class="field field--name-created field--type-created field--label-hidden">Nov 11 2014</span> <div class="field field--name-field-tagies field--type-entity-reference field--label-above"> <div class="field__label">Tags</div> <div class='field__items'> <div class="field__item"><i class="fa fa-tags"></i> <a href="/Fun" hreflang="en">Fun</a></div> <div class="field__item"><i class="fa fa-tags"></i> <a href="/tags/mathematics" hreflang="en">Mathematics</a></div> </div> </div> <section class="field field--name-comment-node-blog field--type-comment field--label-hidden comment-wrapper"> </section> <section class="field field--name-comment field--type-comment field--label-above comment-wrapper"> <h2 class='title comment-form__title'> <i class="fa fa-comments-o"></i> Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=8&amp;2=comment&amp;3=comment" token="E4cewAAI5o_IFtONKG0oHArjRnZv_4JAc-CnRnLmMO4"></drupal-render-placeholder> </section> Tue, 11 Nov 2014 07:47:11 +0000 Hoti 8 at https://tech.feedyourhead.at