I think that, I know what you are after. It would be fun to see math equations solved step by step automatically. Your input is an equation and as output you want to get step by step answers. You need to define the steps and precedence. In the case you have presented, for example, you might want to do cross multiplication of the numbers within the parantheis and then remove the paranthesis and make it more simple before getting the final answer. It would be fun to define all these rules for different equations. Once you do that, you will have better control of working of math euqation and will serve a useful aid in your teaching.

For coding these, you may define each element as a seperate entitiy in your euqation. Parse::RecDescent would be very useful for this. Once you have elements and their positions within equation, you may apply your rules to create the next step and so on.


In reply to Re: Perl and maths by artist
in thread Perl and maths by ReinhardE

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.