<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Implementation of Dynamic Algebra in Epsilonwriter</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Jean-François Nicaud</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Christophe Viudez Aristod</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>rue de Paris</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Palaiseau</string-name>
        </contrib>
      </contrib-group>
      <abstract>
        <p>Dynamic Algebra is “doing algebraic calculations on a computer by direct manipulation”. We have implemented Dynamic Algebra in the Epsilonwriter application. For that purpose, a “Theory of Movements in Formulas” (TMF) has been elaborated. It describes, in a precise context, how we can move a sub-expression in a formula with preservation of equivalence. It has been implemented in Epsilonwriter for the Pedagogical Dynamic Algebra mode. Dynamic Algebra in Epsilonwriter has other modes with more complex actions of different classes: equivalent drag &amp; drop internal to a formula, external drag &amp; drop, on click calculations and rewriting rule application. This makes Epsilonwriter a very powerful and flexible calculation tool for step by step calculations; and a tool able to provide explanations. Epsilonwriter contains different options to control the possible movements and the feedback on them. It has been developed to help students learn formula structure and transformations, and to help every user produce step by step explained calculations.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <sec id="sec-1-1">
        <title>Initial formula</title>
      </sec>
      <sec id="sec-1-2">
        <title>Transformed formula</title>
      </sec>
      <sec id="sec-1-3">
        <title>Displayed on the screen Gesture to get the next line</title>
        <p>(
(
(
(
(
(
)(
)(
)( (
)(
)(
)(
)
)
)
(
(</p>
        <p>)
) Factorizing
) Expansion
) Adding like terms
) Factoring HCF:
(</p>
        <p>)is dragged in front of the expression
is dragged in front of (</p>
        <p>)
is dragged into (</p>
        <p>)
is dragged over
is dragged in front of the expression
Previous prototypes of Dynamic Algebra systems performed the equivalent drag &amp; drop like in table 1 and 2,
but without explanation. In our opinion, they have had no success because:
- The transformations were well done in expected situations, but it was difficult to obtain what you really
wanted. The initial expression was instantly transformed, so there was some kind of control loss.
- No explanations were provided about the transformation done.
- The field of application was rather limited.</p>
        <p>We have implemented Dynamic Algebra in Epsilonwriter (Nicaud &amp; Viudez 2009). In designing and
implementing Dynamic Algebra, we aimed at facilitating the treatment of formulas on computers, especially
ease the production of step by step calculations driven by transformation rules and requested by gestures.
Our two main goals are: (1) helping students to learn formula structure and transformations; (2) helping
every user to produce step by step explained calculations.</p>
        <p>Beside the equivalent drag &amp; drop we have introduced above, which is internal drag &amp; drop (all happens in a
single formula) the other classes of actions of Dynamic Algebra in Epsilonwriter are:
(1) External drag &amp; drop as dropping a formula on another formula. A typical example is applying a
substitution, e.g., dropping { on to get (( ))
(2) On click calculation, e.g., selecting and applying a Ctrl+Click on ( ) ( ) in order to
add like terms and get ( )
(3) Rewriting rules, e.g., applying
to
to get
For designing the equivalent drag &amp; drop of basic elements as introduced in table 1, we have developed the
Theory of Movements in Formulas (TFM) which defines a correspondence between mathematical properties
of a formula and gestures which are allowed on it in the framework of basic movements. This theory is
presented in section 2. Section 3 describes its implementation in Epsilonwriter and section 4 the internal drag
&amp; drop beyond TMF. Section 5 is devoted to external drag &amp; drop and on click calculations, and section 6 to
rewriting rules.</p>
        <p>This paper describes dynamic elements on a static paper like support. Demos can be seen at
http://www.epsilonwriter.com/en/top10demos/ to have a better view of the dynamic aspects.</p>
        <p>2. The Theory of Movements in Formulas (TMF)
The Theory of Movements in Formulas (TMF) (Nicaud, 2013) is based on the possibility to move
subexpressions in formulas respecting the equivalence between the starting formula and the transformed
formula. The question to which TMF replies is the following:</p>
        <p>When can we move a sub-expression from here to there, getting an equivalent expression?
As we are talking about algebraic expressions, a sub-expression is not just something which is ‘put there’ in
a formula. It is attached to the rest of the formula by means of an operator (+, –, …). This gives to the
subexpression a status with regard to its parent sub-expression. For instance, in the expression , 2
has
a multiplier status in (multiplier of
(adder of ), 5 has a divisor status in (divisor of ).</p>
        <p>TMF identifies three different statuses: adder, multiplier and divisor (no status is attached to the subtraction,
is seen as the sum of and– ), and considers the movements of a sub-expression u through operators
(+ – / and relations) which preserve equivalence. The internal question is more precisely the following:
Is it possible to move from here to there, being unchanged or changed to
being unchanged except possibly the orientation of an inequality?
, the rest of the formula
For instance, in the equation
side (being viewed as</p>
        <p>, the sub-expression can be considered as an adder in the left-hand
); it can be moved to the right-hand side, keeping adder status and being
),
3
has
an
adder
status</p>
        <p>in
changed to
, coming to
. It can also be considered as a multiplier (being viewed as
) and
be moved to the right-hand side, remaining unchanged and getting the divisor status, obtaining
TMF is based on three classes of movements which can be described as follows:
(1) Moving at the same level, e.g., application of the commutative law;
(2) Entering into an expression, e.g., in
can enter into the numerator as a multiplier, providing
.
;
(3) Exiting an expression, e.g., in
can exit the numerator as a multiplier, providing
.</p>
        <p>Elementary movements can be combined, e.g.,
in
can move to get
. This is a
combination: (1)
exits
as multiplier, (2)
moves to the right as divisor of
; (3)
enters the
denominator of</p>
        <p>as multiplier of 3 .</p>
        <p>TMF also considers movements of minus sign taking into account that a minus sign can be viewed as a
multiplier –1. For example, a minus sign can exit the numerator of
getting
because the multiplier
can exit the numerator of ( ) getting (</p>
        <p>)
For the fundamental operators + × / and relations, within the considered status and classes of movements,
TMF identifies 74 cases and 56 of them produce correct transformations, which corresponds to 76% (Nicaud,
2013). This high rate lead us to think that ‘gestures’ which correspond to the movements of TMF can be
considered as meaningful objects of algebraic manipulations.</p>
        <p>This result can be considered as a part of the explanation of mathematics education observations (Kieran,
2007; Wittmann et al., 2013) which highlight that students (in particular students doing correct calculations)
use gestures: ‘gestures and ambiguous speech of moving are the only algebra used at that moment’.</p>
        <p>3. Implementation of TMF in Epsilonwriter
Epsilonwriter is a multi-document “text and math” editor. It provides a smooth editing, an easy
communication and publishing of math and science contents (Nicaud &amp; Viudez 2009), see figure 1.
From its beginning, Epsilonwriter contains a structural drag &amp; drop of formulas which proposes several ways
to drop a sub-expression u, i.e., several operators (+ – …) to attach u to the formula at the drop position.
Dynamic Algebra in Epsilonwriter is a rich system with several options. The Pedagogical Dynamic Algebra
mode implements the TMF. The equivalent drops of the TMF are added to the structural drops, see figure 2.</p>
        <p>The presentation on the screen of the application of a drop depends on display options. With Explain
calculations on the same line (the line of the result), the first proposition of figure 2 produces:</p>
        <p>Addition to both sides of
With the option Explain Dynamic Algebra in a table the result is:
With the option Describe the dynamic algebra gesture, result is:</p>
        <p>Addition to both sides of
Gesture: Additive move to the other side, changing sign</p>
        <p>Explanation: Addition to both sides of
It is possible to display neither explanations nor gesture descriptions. It is also possible to have the initial
formula replaced by the result instead of having the result below.</p>
        <p>TMF contains correct and incorrect movements. In the Pedagogical Dynamic Algebra mode, the user can get
the indication of the absence of a TMF correct movement, see figure 3.</p>
        <p>4. Internal drag &amp; drop beyond TMF
The Pedagogical Dynamic Algebra intends to help students to understand the structure of formulas and the
possible basic movements. The other modes (light, medium, strong) of Dynamic Algebra in Epsilonwriter
contain additional possibilities in order to allow more calculations produced with gestures. The main ones
are described in table 3. For these modes, there is no indication of impossible movements. The display
options are identical to the Pedagogical Dynamic Algebra ones.</p>
        <sec id="sec-1-3-1">
          <title>Description</title>
          <p>Factorizing by exiting a sub-expression from a sum
Factorizing a HCF by exiting a integer from a sum
Expanding by entering a factor in a sum
Expanding by entering an exponent in a sum
Entering an exponent in an opposite or a product
Entering an exponent in a fraction or a power
Additive exit from a numerator
Additive entry into a numerator
Addition of like terms
Simplification in a fraction of like factors and minus signs
Simplification in a fraction with HCF
Completing the square by dropping</p>
          <p>on
Decomposition of an equation
exponent 2 on the other side of =
(
(</p>
          <p>(
( )
)
)</p>
          <p>)
(
)
(</p>
          <p>)
(
(
(
(</p>
          <p>Example
)</p>
          <p>)
(</p>
          <p>)
( )
)
)
by dropping the
(
)
√
√</p>
          <p>5. External drag &amp; drop and on click calculations</p>
          <p>5.1. External drag &amp; drop
External drag &amp; drop means dragging an expression and dropping it on another one, the two expressions
being separated, i.e., not being part of a same formula. For example, expression a is followed by a text
followed by expression b. In this case, pointing is different from internal drag &amp; drop as there is no
destination cursor position but an entire expression as destination. So, during the drag, when the mouse
cursor is over the operator of the destination expression, the expression background is blue, indicating the
drop is possible. See figure 4.</p>
          <p>has been selected, it appears with a yellow background. A drag has been
done and the mouse is over a + sign, thus the expression 3x+y+1 is selected (+ is its main operator) and
appears with a blue background. The substitution is proposed (not visible in the figure). By releasing the
mouse button at this time, the expression on the right is obtained.</p>
          <p>Another kind of external drag &amp; drop is the drop of a numerical expression a on an equality or inequality. In
this case, Epsilonwriter proposes an operation on both sides of the equality or the inequality among: add,
subtract, multiply and divide. The last two operations are only proposed for an inequality when a is constant
and not null.</p>
          <p>Finally there is the drag &amp; drop of an equality (or inequality) on another equality (or inequality) to add or
subtract side by side when the result of the operation is implied by the two equalities or inequalities.</p>
          <p>5.2. On click calculations
On click calculations mainly allows performing numerical calculations, additions of like terms and
multiplications of like factors. The domain of numerical calculations is chosen by the user with the options
menu. Currently, it may be the integer, decimal or rational numbers.</p>
          <p>Two gestures allow performing a calculation click. The first one consists in selecting an expression or a
subexpression and of doing a Ctrl+Click on it. Examples:
Selection of
Selection of (
Selection of (
and Ctrl+Click, result</p>
          <p>(calculation over the rational numbers).</p>
          <p>)
)(
( ) and Ctrl+Click, result ( ) (addition of like terms).</p>
          <p>) and Ctrl+Click, result ( ) (multiplication of like factors).</p>
          <p>The second one consists of doing a Ctrl+Click on an operator to ask for calculating the expression of which
this operator is the main operator.</p>
          <p>Example: In (
)</p>
          <p>Ctrl+Click on +, the result is
(calculation over the rational numbers of
).</p>
          <p>5.3. Solving quadratic and cubic equations
Epsilonwriter helps to solve quadratic and cubic equations thanks to Dynamic Algebra. First, it displays a
solving schema, see figure 5.
{
{
---------------------------------</p>
          <p>√
{ }
√
√</p>
          <p>√
---------------------------------{
}
{
}
Then, Dynamic Algebra facilitates the calculations. In the case of the equation of figure 5, the user can
continue as follows. (1) drop {
over
getting
; (2) selection and
Ctrl+Click on the right hand side of this, getting
; (3) suppression of the useless schemas
and
; (4) drop of
over
√
√
√
and drop of {</p>
          <p>over the result providing
{
√
√
√
(
(
(
√</p>
          <p>)
(</p>
          <p>)
(
(
√
√
)
)
)
)</p>
          <p>to make the degree 2 term disappear. Of course, quadratic equations are also handled.</p>
          <p>5.4. The calculation panel of Epsilonwriter
Dynamic Algebra in Epsilonwriter has several modes and options which are chosen using the calculation
panel, see figure 6. The Dynamic algebra mode allows choosing which movements are allowed and are
automatically calculated. Dynamic algebra: Pedagogical suits for basic learning goals and allows only the
basic movements of the TMF (it also provides the “no movement” messages). Other modes of Dynamic
Algebra progressively increases the number of movements allowed. The display options offer flexibility in
the display of explanations and allow choosing if the gestures are described or not.
All these modes and options can fit different use cases from didactical ones with clear steps and
explanations on gestures, to calculations of expert with fast expression change as soon as the mouse is
released. Preview of the result in the popup is a key feature: it gives a feedback to check that what will be
done is relevant with the user’s intent. Moreover on complex expressions, it gives a preview of what will be
the result and so can help in strategic decisions during the calculation.</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>6. Rewriting</title>
      <p>A rewriting rule is a formula like which means a is (or can be) rewritten as b. Rewriting is a
fundamental sub-domain of computer science and is used in various contexts such as mathematical formula
processing, natural language processing… In algebra, we use them when we apply identities. Thus
( )( ) is a rewriting rule for factorizing. The reverse rule is a rewriting rule for
expanding. In this notation, a and b are matching variables as they are used to be matched with any
subexpression. For example,
matches the expression ( )
for the substitution</p>
      <p>Rewriting in Epsilonwriter is at its very beginning. It is implemented with the Find/Replace panel: Left part
of the rule is written in the “Find” field whereas the right one in the “Replace with” field.
Matching variables currently have to be indicated with a special operator that circles them, e.g., in
(the copy and paste mechanism replaces in Word the circle by a rectangle). In this example is a matching
variable that can match anything whereas b is a fixed letter that can only match . Table 4 shows examples
of rewritings made with Epsilonwriter.</p>
      <sec id="sec-2-1">
        <title>Searched form</title>
      </sec>
      <sec id="sec-2-2">
        <title>Rewritten form</title>
      </sec>
      <sec id="sec-2-3">
        <title>Matched form Rewriting obtained</title>
        <p>(
)
(
√
)
(
)
(
(
)(
)
√
(
√</p>
        <p>)
)
(
)
(</p>
        <p>)
In the future, rewriting will be improved in Epsilonwriter. It will be possible to use the classical notation
, to have sets of rules, to drop a rule or a set of rules on a formula.</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>7. Conclusion</title>
      <p>With dynamic algebra, Epsilonwriter bring virtual gestures to concrete UI movements and so add smooth
automatic calculations to formula editing. From a general point of view, we think that this will improve
significantly formula editing, especially because there is no wall between editing and calculating, no need for
a distinct UI and because the user can control precisely what the result will be. In terms of education, we
believe it can provide important assistance in the writing of reasoning by teachers and students, but it can
also promote the learning of algebra in helping students to know the correct actions and their justifications.
Epsilonwriter provides a rich dynamic algebra implementation and we will add new functions for square
roots, trigonometry and exponentials. Epsilonwriter is also more than a dynamic algebra dedicated software,
it is a very powerful document editor with lots of publishing and communication functions, like
multidocument editing, rich import and export possibilities. It also offers a chat and online multiuser shared
documents.</p>
      <p>We hope that a growing community will use Epsilonwriter and join us to participate in the diffusion and the
evolution of Dynamic Algebra.</p>
    </sec>
    <sec id="sec-4">
      <title>8. References</title>
      <p>Kieran, C. (2006). Research on the learning and teaching of algebra. In A. Gutiérrez &amp; P. Boero (Eds.),
Handbook of research on the psychology of mathematics education (pp. 11-50). Rotterdam: Sense.
Nicaud, J.F. (2013). La théorie des mouvements dans les formules. http://epsilonwriter.com/TMF
Nicaud J.F., Mercat C. (2012). Algèbre dynamique, glisser-déposer par équivalence. Actes des Journées
mathématiques de l'Institut Français de l'Éducation (ENS de Lyon).</p>
      <p>Nicaud J.F., Viudez, C. (2009). Epsilonwriter: implementing new ideas for typing text and math. In
Proceedings of The MathUI workshop 2009. Grand Bend, Ontario, Canada.</p>
      <p>Wittmann, M.C., Flood, M.C., Black, K.E. (2013). Algebraic manipulation as motion within a landscape.
Educational Studies in Mathematics vol 82(2), pp 169–181.</p>
    </sec>
  </body>
  <back>
    <ref-list />
  </back>
</article>