Top-rated recipes by Fouad Teniou http://code.activestate.com/recipes/users/4155345/top/2011-02-03T12:31:50-08:00ActiveState Code RecipesMaclaurin's_series_sinh-1(x) (Python) 2010-09-28T11:52:21-07:00Fouad Teniouhttp://code.activestate.com/recipes/users/4155345/http://code.activestate.com/recipes/577401-maclaurins_series_sinh-1x/ <p style="color: grey"> Python recipe 577401 by <a href="/recipes/users/4155345/">Fouad Teniou</a> (<a href="/recipes/tags/mathematics/">mathematics</a>). </p> <p>C. Maclaurin. A Scottish mathematician gained his master degree at age 17, and his major mathematics' work arise from his special knowledge in Newton's ideas and the formulation of Newton's methods.</p> <p>However, C. Maclaurin also contributed to the astronomy science and helped to improve maps and invented some mechanical devices .</p> <p>My mathematics python's programs is a set of Maclaurin's series to compute some of the most important functions in calculus.</p> <p>Though, the computation of an infinite sum which give the value of a function in terms of the derivatives evaluated at a special case where x0 = 0,in contrast with Taylor's series. </p> <p>Natural logarithms are used to compute inverse hyperbolic functions.</p> Maclaurin's_series_cosh-1(x) (Python) 2010-09-28T11:53:08-07:00Fouad Teniouhttp://code.activestate.com/recipes/users/4155345/http://code.activestate.com/recipes/577400-maclaurins_series_cosh-1x/ <p style="color: grey"> Python recipe 577400 by <a href="/recipes/users/4155345/">Fouad Teniou</a> (<a href="/recipes/tags/mathematics/">mathematics</a>). </p> <p>C. Maclaurin. A Scottish mathematician gained his master degree at age 17, and his major mathematics' work arise from his special knowledge in Newton's ideas and the formulation of Newton's methods.</p> <p>However, C. Maclaurin also contributed to the astronomy science and helped to improve maps and invented some mechanical devices .</p> <p>My mathematics python's programs is a set of Maclaurin's series to compute some of the most important functions in calculus.</p> <p>Though, the computation of an infinite sum which give the value of a function in terms of the derivatives evaluated at a special case where x0 = 0,in contrast with Taylor's series. </p> <p>Natural logarithms are used to compute inverse hyperbolic functions.</p> Maclaurin's_series_tanh-1(x) (Python) 2010-09-28T11:50:45-07:00Fouad Teniouhttp://code.activestate.com/recipes/users/4155345/http://code.activestate.com/recipes/577399-maclaurins_series_tanh-1x/ <p style="color: grey"> Python recipe 577399 by <a href="/recipes/users/4155345/">Fouad Teniou</a> (<a href="/recipes/tags/mathematics/">mathematics</a>). </p> <p>C. Maclaurin. A Scottish mathematician gained his master degree at age 17, and his major mathematics' work arise from his special knowledge in Newton's ideas and the formulation of Newton's methods.</p> <p>However, C. Maclaurin also contributed to the astronomy science and helped to improve maps and invented some mechanical devices .</p> <p>My mathematics python's programs is a set of Maclaurin's series to compute some of the most important functions in calculus.</p> <p>Though, the computation of an infinite sum which give the value of a function in terms of the derivatives evaluated at a special case where x0 = 0,in contrast with Taylor's series. </p> <p>Natural logarithms are used to compute inverse hyperbolic functions.</p> Maclaurin's_series_cos² (x) (Python) 2010-08-03T12:21:22-07:00Fouad Teniouhttp://code.activestate.com/recipes/users/4155345/http://code.activestate.com/recipes/577345-maclaurins_series_cos2-x/ <p style="color: grey"> Python recipe 577345 by <a href="/recipes/users/4155345/">Fouad Teniou</a> (<a href="/recipes/tags/mathematics/">mathematics</a>). Revision 4. </p> <p>C. Maclaurin. A Scottish mathematician gained his master degree at age 17, and his major mathematics' work arise from his special knowledge in Newton's ideas and the formulation of Newton's methods.</p> <p>However, C. Maclaurin also contributed to the astronomy science and helped to improve maps and invented some mechanical devices .</p> <p>My mathematics python's programs is a set of Maclaurin's series to compute some of the most important functions in calculus.</p> <p>Though, the computation of an infinite sum which give the value of a function in terms of the derivatives evaluated at a special case where x0 = 0,in contrast with Taylor series. </p> <p>There are several ways of finding Maclaurin’s series, and I used the multiplication and the division to develop my own maclaurin’s series for cos(2x) and cos²(x).</p> <p>Cos(2x) = 2cos²(x) - 1 and cos²(x) = (cos(2x)+1)/2</p> <p>However, integration and differentiation could also be used to find Maclaurin’s series. </p> Maclaurin's_series_cos(2x) (Python) 2010-08-03T12:23:33-07:00Fouad Teniouhttp://code.activestate.com/recipes/users/4155345/http://code.activestate.com/recipes/577344-maclaurins_series_cos2x/ <p style="color: grey"> Python recipe 577344 by <a href="/recipes/users/4155345/">Fouad Teniou</a> (<a href="/recipes/tags/mathematics/">mathematics</a>). Revision 2. </p> <p>C. Maclaurin. A Scottish mathematician gained his master degree at age 17, and his major mathematics' work arise from his special knowledge in Newton's ideas and the formulation of Newton's methods.</p> <p>However, C. Maclaurin also contributed to the astronomy science and helped to improve maps and invented some mechanical devices .</p> <p>My mathematics python's programs is a set of Maclaurin's series to compute some of the most important functions in calculus.</p> <p>Though, the computation of an infinite sum which give the value of a function in terms of the derivatives evaluated at a special case where x0 = 0,in contrast with Taylor series. </p> <p>There are several ways of finding Maclaurin’s series, and I used the multiplication and the division to develop my own maclaurin’s series for cos(2x) and cos²(x).</p> <p>Cos(2x) = 2cos²(x) - 1 and cos²(x) = (cos(2x)+1)/2</p> <p>However, integration and differentiation could also be used to find Maclaurin’s series. </p> Maclaurin's_series_ln(x)_decimal_module_version (Python) 2011-01-20T12:09:24-08:00Fouad Teniouhttp://code.activestate.com/recipes/users/4155345/http://code.activestate.com/recipes/577307-maclaurins_series_lnx_decimal_module_version/ <p style="color: grey"> Python recipe 577307 by <a href="/recipes/users/4155345/">Fouad Teniou</a> (<a href="/recipes/tags/mathematics/">mathematics</a>). Revision 5. </p> <p>C. Maclaurin. A Scottish mathematician gained his master degree at age 17, and his major mathematics' work arise from his special knowledge in Newton's ideas and the formulation of Newton's methods.</p> <p>However, C. Maclaurin also contributed to the astronomy science and helped to improve maps and invented some mechanical devices .</p> <p>My mathematics python's programs is a set of Maclaurin's series to compute some of the most important functions in calculus.</p> <p>Though, the computation of an infinite sum which give the value of a function in terms of the derivatives evaluated at a special case where x0 = 0,in contrast with Taylor series. </p> <p>The maclaurin's series approximation for ln(1+x) is used to approximate ln(x) by detucting the maclaurin's series for ln(1-x). ln(1+x) - ln(1-x) = ln(1+x/1-x)and by letting y = (1+x/1-x), y could take any positive value.</p> <p>y = 1+x/1-x, therefore x = y-1/y+1 </p> <p>-1 &lt; x &lt; 1</p> Maclaurin's_series_ln(x) (Python) 2010-07-15T11:16:30-07:00Fouad Teniouhttp://code.activestate.com/recipes/users/4155345/http://code.activestate.com/recipes/577300-maclaurins_series_lnx/ <p style="color: grey"> Python recipe 577300 by <a href="/recipes/users/4155345/">Fouad Teniou</a> (<a href="/recipes/tags/mathematics/">mathematics</a>). Revision 8. </p> <p>C. Maclaurin. A Scottish mathematician gained his master degree at age 17, and his major mathematics' work arise from his special knowledge in Newton's ideas and the formulation of Newton's methods.</p> <p>However, C. Maclaurin also contributed to the astronomy science and helped to improve maps and invented some mechanical devices .</p> <p>My mathematics python's programs is a set of Maclaurin's series to compute some of the most important functions in calculus.</p> <p>Though, the computation of an infinite sum which give the value of a function in terms of the derivatives evaluated at a special case where x0 = 0,in contrast with Taylor series. </p> <p>The maclaurin's series approximation for ln(1+x) is used to approximate ln(x) by detucting the maclaurin's series for ln(1-x). ln(1+x) - ln(1-x) = ln(1+x/1-x)and by letting y = (1+x/1-x), y could take any positive value.</p> <p>y = 1+x/1-x, therefore x = y-1/y+1 </p> <p>-1 &lt; x &lt; 1 </p> Maclaurin's_series_exponential(x) (Python) 2010-07-07T12:52:28-07:00Fouad Teniouhttp://code.activestate.com/recipes/users/4155345/http://code.activestate.com/recipes/577293-maclaurins_series_exponentialx/ <p style="color: grey"> Python recipe 577293 by <a href="/recipes/users/4155345/">Fouad Teniou</a> (<a href="/recipes/tags/mathematics/">mathematics</a>). </p> <p>C. Maclaurin. A Scottish mathematician gained his master degree at age 17, and his major mathematics' work arise from his special knowledge in Newton's ideas and the formulation of Newton's methods.</p> <p>However, C. Maclaurin also contributed to the astronomy science and helped to improve maps and invented some mechanical devices .</p> <p>My mathematics python's programs is a set of Maclaurin's series to compute some of the most important functions in calculus.</p> <p>Though, the computation of an infinite sum which give the value of a function in terms of the derivatives evaluated at a special case where x0 = 0,in contrast with Taylor series. </p> <p>The natural exponential function e^x has a constant base e and a variable x and Maclaurin's series to approximate the natural exponential converge on the interval ]-inf , + inf [.</p> Maclaurin's_series_function(1/1-x²) (Python) 2010-07-07T12:44:17-07:00Fouad Teniouhttp://code.activestate.com/recipes/users/4155345/http://code.activestate.com/recipes/577292-maclaurins_series_function11-x2/ <p style="color: grey"> Python recipe 577292 by <a href="/recipes/users/4155345/">Fouad Teniou</a> (<a href="/recipes/tags/mathematics/">mathematics</a>). </p> <p>C. Maclaurin. A Scottish mathematician gained his master degree at age 17, and his major mathematics' work arise from his special knowledge in Newton's ideas and the formulation of Newton's methods.</p> <p>However, C. Maclaurin also contributed to the astronomy science and helped to improve maps and invented some mechanical devices .</p> <p>My mathematics python's programs is a set of Maclaurin's series to compute some of the most important functions in calculus.</p> <p>Though, the computation of an infinite sum which give the value of a function in terms of the derivatives evaluated at a special case where x0 = 0,in contrast with Taylor series.</p> <p>Maclaurin's series to approximate f(x) = (1/1-x^2)</p> Maclaurin's_series_function(1/1-x) (Python) 2010-07-07T12:36:23-07:00Fouad Teniouhttp://code.activestate.com/recipes/users/4155345/http://code.activestate.com/recipes/577291-maclaurins_series_function11-x/ <p style="color: grey"> Python recipe 577291 by <a href="/recipes/users/4155345/">Fouad Teniou</a> (<a href="/recipes/tags/mathematics/">mathematics</a>). </p> <p>C. Maclaurin. A Scottish mathematician gained his master degree at age 17, and his major mathematics' work arise from his special knowledge in Newton's ideas and the formulation of Newton's methods.</p> <p>However, C. Maclaurin also contributed to the astronomy science and helped to improve maps and invented some mechanical devices .</p> <p>My mathematics python's programs is a set of Maclaurin's series to compute some of the most important functions in calculus.</p> <p>Though, the computation of an infinite sum which give the value of a function in terms of the derivatives evaluated at a special case where x0 = 0,in contrast with Taylor series.</p> <p>Maclaurin's series to approximate f(x) = 1/1-x</p> Maclaurin's_series_ln(1+x) (Python) 2010-07-07T12:28:36-07:00Fouad Teniouhttp://code.activestate.com/recipes/users/4155345/http://code.activestate.com/recipes/577290-maclaurins_series_ln1x/ <p style="color: grey"> Python recipe 577290 by <a href="/recipes/users/4155345/">Fouad Teniou</a> . </p> <p>C. Maclaurin. A Scottish mathematician gained his master degree at age 17, and his major mathematics' work arise from his special knowledge in Newton's ideas and the formulation of Newton's methods.</p> <p>However, C. Maclaurin also contributed to the astronomy science and helped to improve maps and invented some mechanical devices.</p> <p>My mathematics python's programs is a set of Maclaurin's series to compute some of the most important functions in calculus.</p> <p>Though, the computation of an infinite sum which give the value of a function in terms of the derivatives evaluated at a special case where x0 = 0,in contrast with Taylor series. </p> <p>The Maclaurin's series for ln(1+x) could be used to approximate the natural logarithm ln(x).</p> Maclaurin's_series_tan-1 (Python) 2010-07-07T12:21:44-07:00Fouad Teniouhttp://code.activestate.com/recipes/users/4155345/http://code.activestate.com/recipes/577289-maclaurins_series_tan-1/ <p style="color: grey"> Python recipe 577289 by <a href="/recipes/users/4155345/">Fouad Teniou</a> (<a href="/recipes/tags/mathematics/">mathematics</a>). </p> <p>C. Maclaurin. A Scottish mathematician gained his master degree at age 17, and his major mathematics' work arise from his special knowledge in Newton's ideas and the formulation of Newton's methods.</p> <p>However, C. Maclaurin also contributed to the astronomy science and helped to improve maps and invented some mechanical devices.</p> <p>My mathematics python's programs is a set of Maclaurin's series to compute some of the most important functions in calculus.</p> <p>Though, the computation of an infinite sum which give the value of a function in terms of the derivatives evaluated at a special case where x0 = 0,in contrast with Taylor series. </p> <p>Maclaurin's series for tan-1 function is achieved by integrating the function f(x)= 1/(1+x^2). However, this approach could be used to find Maclaurin's series for others functions.</p> Maclaurin's_series_sinh (Python) 2010-07-07T12:08:34-07:00Fouad Teniouhttp://code.activestate.com/recipes/users/4155345/http://code.activestate.com/recipes/577288-maclaurins_series_sinh/ <p style="color: grey"> Python recipe 577288 by <a href="/recipes/users/4155345/">Fouad Teniou</a> (<a href="/recipes/tags/mathematics/">mathematics</a>). </p> <p>C. Maclaurin. A Scottish mathematician gained his master degree at age 17, and his major mathematics' work arise from his special knowledge in Newton's ideas and the formulation of Newton's methods.</p> <p>However, C. Maclaurin also contributed to the astronomy science and helped to improve maps and invented some mechanical devices.</p> <p>My mathematics python's programs is a set of Maclaurin's series to compute some of the most important functions in calculus.</p> <p>Though, the computation of an infinite sum which give the value of a function in terms of the derivatives evaluated at a special case where x0 = 0,in contrast with Taylor series. </p> <p>Hyperbolic functions are very common in the engineering field and they are related to trigonometric functions, thus, trigonometric functions could be expressed in terms of exponential(x) The hyperbolic sine sinh(x) = (e^x - e^-x)/2.</p> Maclaurin's_series_sin (Python) 2010-07-07T12:05:33-07:00Fouad Teniouhttp://code.activestate.com/recipes/users/4155345/http://code.activestate.com/recipes/577287-maclaurins_series_sin/ <p style="color: grey"> Python recipe 577287 by <a href="/recipes/users/4155345/">Fouad Teniou</a> (<a href="/recipes/tags/mathematics/">mathematics</a>). </p> <p>C. Maclaurin. A Scottish mathematician gained his master degree at age 17, and his major mathematics' work arise from his special knowledge in Newton's ideas and the formulation of Newton's methods.</p> <p>However, C. Maclaurin also contributed to the astronomy science and helped to improve maps and invented some mechanical devices.</p> <p>My mathematics python's programs is a set of Maclaurin's series to compute some of the most important functions in calculus.</p> <p>Though, the computation of an infinite sum which give the value of a function in terms of the derivatives evaluated at a special case where x0 = 0,in contrast with Taylor series. </p> <p>It is assumed that the angle is expressed in radian while using the Maclaurin's series to approximate the trigonometric functions sine and cosine, thus, converting the angle into degrees in my program could be useful for students who prefer using degrees.</p> Maclaurin's_series_cosh (Python) 2010-07-07T12:01:34-07:00Fouad Teniouhttp://code.activestate.com/recipes/users/4155345/http://code.activestate.com/recipes/577286-maclaurins_series_cosh/ <p style="color: grey"> Python recipe 577286 by <a href="/recipes/users/4155345/">Fouad Teniou</a> (<a href="/recipes/tags/mathematics/">mathematics</a>). Revision 2. </p> <p>C. Maclaurin. A Scottish mathematician gained his master degree at age 17, and his major mathematics' work arise from his special knowledge in Newton's ideas and the formulation of Newton's methods.</p> <p>However, C. Maclaurin also contributed to the astronomy science and helped to improve maps and invented some mechanical devices.</p> <p>My mathematics python's programs is a set of Maclaurin's series to compute some of the most important functions in calculus.</p> <p>Though, the computation of an infinite sum which give the value of a function in terms of the derivatives evaluated at a special case where x0 = 0,in contrast with Taylor series. </p> <p>Hyperbolic functions are very common in the engineering field and they are related to trigonometric functions, thus, trigonometric functions could be expressed in terms of exponential(x) The hyperbolic cosine cosh(x) =(e^x + e^-x)/2.</p> Maclaurin's_series_cos (Python) 2010-07-07T11:56:52-07:00Fouad Teniouhttp://code.activestate.com/recipes/users/4155345/http://code.activestate.com/recipes/577285-maclaurins_series_cos/ <p style="color: grey"> Python recipe 577285 by <a href="/recipes/users/4155345/">Fouad Teniou</a> (<a href="/recipes/tags/mathematics/">mathematics</a>). Revision 2. </p> <p>Maclaurin. A Scottish mathematician gained his master degree at age 17, and his major mathematics' work arise from his special knowledge in Newton's ideas and the formulation of Newton's methods.</p> <p>However, C. Maclaurin also contributed to the astronomy science and helped to improve maps and invented some mechanical devices .</p> <p>My mathematics python's programs is a set of Maclaurin's series to compute some of the most important functions in calculus.</p> <p>Though, the computation of an infinite sum which give the value of a function in terms of the derivatives evaluated at a special case where x0 = 0,in contrast with Taylor series. </p> <p>It is assumed that the angle is expressed in radian while using the Maclaurin's series to approximate the trigonometric functions sine and cosine, thus, converting the angle into degrees in my program could be useful for students who prefer using degrees.</p> Maclaurin's_series_binomial_series (Python) 2011-02-03T12:31:50-08:00Fouad Teniouhttp://code.activestate.com/recipes/users/4155345/http://code.activestate.com/recipes/577284-maclaurins_series_binomial_series/ <p style="color: grey"> Python recipe 577284 by <a href="/recipes/users/4155345/">Fouad Teniou</a> (<a href="/recipes/tags/mathematics/">mathematics</a>). Revision 5. </p> <p>C. Maclaurin. A Scottish mathematician gained his master degree at age 17, and his major mathematics' work arise from his special knowledge in Newton's ideas and the formulation of Newton's methods.</p> <p>However, C. Maclaurin also contributed to the astronomy science and helped to improve maps and invented some mechanical devices .</p> <p>My mathematics python's programs is a set of Maclaurin's series to compute some of the most important functions in calculus.</p> <p>Though, the computation of an infinite sum which give the value of a function in terms of the derivatives evaluated at a special case where x0 = 0,in contrast with Taylor series. </p> <p>The Maclaurin's series to approximate ( 1+x)^m is known as a binomial series.</p> <p>However, if m is a an integer and m &gt;= 0 the function f(x ) = (1+x)^m is a polynomial function of degree m and it will converge for all the values of x on the interval ]-inf, +inf [, otherwise it will converge to (1+x)^m only for the values of x on the interval ]-1,1[, thus, the convergence of x will depend on the value of m </p> Anagrams, vowels, and consonants. (Python) 2011-01-19T12:22:10-08:00Fouad Teniouhttp://code.activestate.com/recipes/users/4155345/http://code.activestate.com/recipes/577265-anagrams-vowels-and-consonants/ <p style="color: grey"> Python recipe 577265 by <a href="/recipes/users/4155345/">Fouad Teniou</a> (<a href="/recipes/tags/text/">text</a>). Revision 7. </p> <p>An anagram could be a word, or a sentence, of which the letters could be rearranged to form a different word, or a different sentence.</p> <p>However, vowels and consonants could be combined to form a syllable.</p> <p>Though, counting the numbers of vowels and consonants forming a word or a phrase, is a writing technique to enhance the writing style, and balance the phonetic. </p> <p>My program Anagrams, vowels, and consonants, allows you to compute the numbers of vowels, and consonants forming a word, a sentence, or a full text, and rearrange the letters forming every word within a text in every possible combination, thus, finding anagrams for each word within the sentence.</p> Sphere (Python) 2010-05-06T12:28:12-07:00Fouad Teniouhttp://code.activestate.com/recipes/users/4155345/http://code.activestate.com/recipes/577218-sphere/ <p style="color: grey"> Python recipe 577218 by <a href="/recipes/users/4155345/">Fouad Teniou</a> (<a href="/recipes/tags/mathematics/">mathematics</a>). Revision 3. </p> <p>A sphere is a ball, similar to a circle in three dimension, and all its surface’s points are equidistant from the centre.</p> <p>However, the distance from the centre point to the surface is called the radius, and the equation of the sphere is : (x-a)² + (y-b)² + (z-c)² = r² .</p> <p>(a,b,c) are the coordinates of the centre and r is the radius.</p> Pi_Approximation (Python) 2011-01-27T12:50:56-08:00Fouad Teniouhttp://code.activestate.com/recipes/users/4155345/http://code.activestate.com/recipes/577067-pi_approximation/ <p style="color: grey"> Python recipe 577067 by <a href="/recipes/users/4155345/">Fouad Teniou</a> (<a href="/recipes/tags/mathematics/">mathematics</a>). Revision 3. </p> <p>Pi is a constant, an irrational number and its notation represent the sixteenth letter of the Greek alphabet, though its value is equal to the ratio of a circle’s circumference to its diameter.</p> <p>However, <strong>a Muslim scientist Abu-Abdullah Muhammad Ibn Musa al-Khwarizmi</strong> the founder of algebra ( derived from the Arabic word El-Jabr ), arithmetic, and trigonometry, an astronomer, and a geographer C850 studied and proved Pi’s irrationality.(<strong>algorithm is derived from his name Khwarizmi</strong> ).</p> <p>I used the circle equation x²+y² = 1 of radius 1 centred at (0,0) and the circle area’s formula to approximate Pi value. y²= 1-x² and y = √(1-x²) is the upper semicircle which will extend from x = -1 to x = 1 and the rectangle method is used to approximate this area of an interval [-1,1]. </p> <p>The area of a circle is A = πr², thus the semicircle of radius 1 will have an area A = ½ π(1²).</p> <p>Using my Pi_Approximation program allows you to represent Pi to infinity of digits, and this will depend of the project type and the precision needed, though space programs require to approximate pi at its maximum precision. </p> <p>And my Pi_Approximation program allows you to make a better Pi’s approximation than the scientific Calculators </p>