Direct Algebraic Logic
Encyclopedia
There are various ways in which a calculator
Calculator
An electronic calculator is a small, portable, usually inexpensive electronic device used to perform the basic operations of arithmetic. Modern calculators are more portable than most computers, though most PDAs are comparable in size to handheld calculators.The first solid-state electronic...

 might interpret key strokes.

One can categorize calculators into two main types: 1) single-step or immediate execution calculators and 2) expression or formula calculators.

On a formula calculator one types in an expression and then presses 'Enter' to evaluate the expression. There are various systems for typing in an expression: infix, postfix, natural display etc.

On an immediate execution calculator, the user presses a key for each operation, by pressing keys to calculate all the intermediate results, before the final value is shown.

Immediate execution

With the immediate execution mode of operation each binary operation
Binary operation
In mathematics, a binary operation is a calculation involving two operands, in other words, an operation whose arity is two. Examples include the familiar arithmetic operations of addition, subtraction, multiplication and division....

 is executed as soon as the next operator is pressed, therefore the order of operations
Order of operations
In mathematics and computer programming, the order of operations is a rule used to clarify unambiguously which procedures should be performed first in a given mathematical expression....

 in a mathematical expression is not taken into account. Scientific calculators have buttons for brackets and these calculators can take order of operation in to account. Also for unary operation
Unary operation
In mathematics, a unary operation is an operation with only one operand, i.e. a single input. Specifically, it is a functionf:\ A\to Awhere A is a set. In this case f is called a unary operation on A....

s like √ or x2 the number is entered first then the operator. Simple 4-function calculators, such as those included with most operating systems, usually use this input method.
Examples
Formula Key strokes Key stroke count


6

6
8


From the first example has been given twice. The first version for simple calculators showing how it is necessary to rearrange operands in order to get the correct result. The second version for scientific calculator
Scientific calculator
A scientific calculator is a type of electronic calculator, usually but not always handheld, designed to calculate problems in science, engineering, and mathematics...

 where operator precedence is observed.

The immediate execution calculators are based on a mixture of infix and postfix notation: binary operations are infix but unary operations are postfix. Because operators are applied one at a time, the user must work out which operator button to use at each stage and this can lead to problems. When discussing these problems, Professor Harold Thimbleby
Harold Thimbleby
Harold W. Thimbleby is a British professor of computer science at Swansea University, Wales. He is known for his works on user interface design within the realm of human computer interaction.- Overview :...

 has pointed out that button-operated calculators “… require numbers and operation signs to be punched in a certain order, and mistakes are easy to make and hard to spot”.

Problems can occur because, for anything but the simplest calculation, to work out the value of a written formula, the user of a button-operated calculator is required to:
  • Rearrange the formula so that the value can be calculated by pressing buttons one at a time, whilst taking operator precedence and parentheses into account.
  • Use memory buttons to ensure that operations are applied in the correct order.
  • Use the special buttons +/− and 1/x, that do not correspond to operations in the formula, for non-commutative operators.


Mistakes can be hard to spot because:
  • For the above reasons, the sequence of button presses may bear little resemblance to the original formula.
  • The operation carried out when a button is pressed is not always the same as the button, but a previously entered operation.

Examples of difficulties

The simplest example of a possible problem when using an immediate execution calculator given by Professor Thimbleby is 4*(−5). As a written formula, the value of this is −20, because the minus sign is intended to indicate a negative number, rather than a subtraction, and this is the way that it would be interpreted by a formula calculator.

On an immediate execution calculator, depending on which keys are used, and the order in which they are pressed, the result for this calculation can be different. Also, among the calculators, there are differences in the way a given sequence of button presses is interpreted. The result can be:
  • −1: If the subtraction button, −, is pressed after the multiplication, *, it is interpreted as a correction of the *, rather than a minus sign, so that 4 − 5 is calculated.
  • 20: If the change-sign button, +/−, is pressed before the 5, it isn’t interpreted as −5, and 4×5 is calculated.
  • −20: To get the right answer, +/− must be pressed last, even though the minus sign isn’t written last in the formula.


The effects of operator precedence, parentheses and non-commutative operators, on the sequence of button presses, are illustrated by:
  • 4 − 5×6: The multiplication must be done first, and the formula has to be rearranged and calculated as −5×6 + 4. So +/− and addition have to be used rather than subtraction. When + is pressed, the multiplication is performed.
  • 4×(5 + 6): The addition must be done first, so the calculation carried out is (5 + 6)×4. When * is pressed, the addition is performed.
  • 4/(5 + 6): One way to do this is to calculate (5 + 6)/4 first, and then use the 1/x button, so the calculation carried out is 1/((5 + 6)/4).
  • 4×5 + 6×7: The two multiplications must be done before the addition, and one of the results must be put into memory.


These are only simple examples, but immediate execution calculators can present even greater problems in more complex cases. In fact, Professor Thimbleby claims that users may have been conditioned to avoid them for all but the simplest calculations.

Declarative and imperative tools

The potential problems with immediate execution calculators stem from the fact that they are imperative
Imperative programming
In computer science, imperative programming is a programming paradigm that describes computation in terms of statements that change a program state...

. This means that the user must provide details of how the calculation has to be performed.

Professor Thimbleby has identified the need for a calculator that is more automatic, and therefore easier to use, and he states that such a calculator should be more declarative
Declarative programming
In computer science, declarative programming is a programming paradigm that expresses the logic of a computation without describing its control flow. Many languages applying this style attempt to minimize or eliminate side effects by describing what the program should accomplish, rather than...

. This means that the user should be able to specify only what has to be done, not how, and in which order, it has to be done.

Formula calculators are more declarative because the typed-in formula specifies what to do, and the user does not have to provide any details of the step-by-step order in which the calculation has to be performed.

Declarative solutions are easier to understand than imperative solutions, and there has been a long-term trend from imperative to declarative methods. Formula calculators are part of this trend.

Many software tools for the general user, such as spreadsheets, are declarative. Formula calculators are examples of such tools.

Using the full power of the computer

Software calculators that simulate hand-held, immediate execution calculators do not use the full power of the computer: “A computer is a far more powerful device than a hand-held calculator, and thus it is illogical and limiting to duplicate hand-held calculators on a computer.” (Haxial Software Pty Ltd) Formula calculators use more of the computer’s power because, besides calculating the value of a formula, they work out the order in which things should be done.
Reverse Polish notation (RPN) (postfix notation)
In reverse Polish notation, also known as postfix notation, all operations are entered after the operand
Operand
In mathematics, an operand is the object of a mathematical operation, a quantity on which an operation is performed.-Example :The following arithmetic expression shows an example of operators and operands:3 + 6 = 9\;...

s on which the operation is performed. Reverse Polish notation is parenthesis-free which usually leads to fewer button presses needed to perform an operation. By the use of stack
Stack (data structure)
In computer science, a stack is a last in, first out abstract data type and linear data structure. A stack can have any abstract data type as an element, but is characterized by only three fundamental operations: push, pop and stack top. The push operation adds a new item to the top of the stack,...

 one can enter formulas without the need to rearrange operands.
An example of a calculator which uses RPN is the HP 48G
HP-48 series
The HP-48 is a series of graphing calculators using Reverse Polish notation and the RPL programming language, produced by Hewlett-Packard from 1990 until 2003. The series include the HP-48S, HP-48SX, HP-48G, HP-48GX, and HP-48G+, the G models being expanded and improved versions of the S models...

.
Examples
Formula Key strokes Key stroke count
7
7


Note example 1 which is one of the few examples where reverse Polish notation does not use the fewest button presses – provided one does not rearrange operands. If one would do so then only 6 key strokes would be needed.
Infix notation
With this mode the precedence of mathematical operators is taken into account.
Most graphing calculators by Casio
Casio graphic calculators
Graphic calculators made by Casio include the touchscreen Classpad 300 as well as the models with traditional buttons which can be divided into two main generations listed below.Casio produced the world's first graphing calculator, the fx-7000G....

 and Texas Instruments
Comparison of Texas Instruments graphing calculators
A graphing calculator is a class of hand-held calculator that is capable of plotting graphs and solving complex functions. There are several companies that manufacture models of graphing calculators. Texas Instruments is a major manufacturer....

 use this method. On its scientific calculator
Scientific calculator
A scientific calculator is a type of electronic calculator, usually but not always handheld, designed to calculate problems in science, engineering, and mathematics...

s, SHARP
Sharp Corporation
is a Japanese multinational corporation that designs and manufactures electronic products. Headquartered in Abeno-ku, Osaka, Japan, Sharp employs more than 55,580 people worldwide as of June 2011. The company was founded in September 1912 and takes its name from one of its founder's first...

 calls this method Direct Algebraic Logic (D.A.L.), and Casio
Casio
is a multinational electronic devices manufacturing company founded in 1946, with its headquarters in Shibuya, Tokyo, Japan. Casio is best known for its electronic products, such as calculators, audio equipment, PDAs, cameras, musical instruments, and watches...

 calls this method Visually Perfect Algebraic Method (V.P.A.M.).
Examples
Formula Key strokes Key stroke count
6
8

BASIC notation

This is a particular implementation of infix notation where functions require their parameters to be in brackets.

This method was used from the 1980s to the 1990s in BASIC programmable calculators and pocket computer
Pocket computer
A pocket computer is a small calculator-sized handheld programmable computer.This specific category of computers existed primarily in the 1980s. Manufacturers included Casio, Hewlett-Packard, Sharp, Tandy/Radio Shack and many more.The programming language was usually BASIC, but some devices...

s. Also, most computer algebra systems use this as the default input method.

In BASIC notation the formula is entered as it would be entered in BASIC PRINT command - the PRINT command itself being optional. On pressing the ENTER the result would be displayed. Typing mistakes in the entered formula could be corrected using the same editor function as available when programming the calculator.
Examples
Formula Key strokes Key stroke count
6


12

16


For the 2nd example two options are give depending if the BASIC programmable pocket computers had dedicated trigonometric keys or not .
Mathematical display

Some calculators allow the entering of equations in a way which things like fractions
Fraction (mathematics)
A fraction represents a part of a whole or, more generally, any number of equal parts. When spoken in everyday English, we specify how many parts of a certain size there are, for example, one-half, five-eighths and three-quarters.A common or "vulgar" fraction, such as 1/2, 5/8, 3/4, etc., consists...

, surds and integral
Integral
Integration is an important concept in mathematics and, together with its inverse, differentiation, is one of the two main operations in calculus...

s are displayed in the way they would normally be written.

Casio used to call this Natural Display or Natural textbook display, but now uses Natural-VPAM.
SHARP
Sharp Corporation
is a Japanese multinational corporation that designs and manufactures electronic products. Headquartered in Abeno-ku, Osaka, Japan, Sharp employs more than 55,580 people worldwide as of June 2011. The company was founded in September 1912 and takes its name from one of its founder's first...

 calls this WriteView on its scientific calculator
Scientific calculator
A scientific calculator is a type of electronic calculator, usually but not always handheld, designed to calculate problems in science, engineering, and mathematics...

s and on its graphing calculators it just uses the term Equation Editor. HP calls this Equation Writer.
Mathematica
Mathematica
Mathematica is a computational software program used in scientific, engineering, and mathematical fields and other areas of technical computing...

 calls this Semantic-Faithful Typesetting. Mathcad
MathCad
Mathcad is computer software primarily intended for the verification, validation, documentation and re-use of engineering calculations. First introduced in 1986 on DOS, it was the first to introduce live editing of typeset mathematical notation, combined with its automatic computations...

 calls this standard math notation. Maple
Maple (software)
Maple is a general-purpose commercial computer algebra system. It was first developed in 1980 by the Symbolic Computation Group at the University of Waterloo in Waterloo, Ontario, Canada....

 has a Math Equation Editor but does not have a special name for this input method. Texas Instruments
Texas Instruments
Texas Instruments Inc. , widely known as TI, is an American company based in Dallas, Texas, United States, which develops and commercializes semiconductor and computer technology...

 calls this Math Print.
Examples
Formula Key strokes Key stroke count
6


9
12


For the second example two options are given depending if the calculators will automatically insert needed parenthesis or not. Machines equipped with an alphanumeric display will display SIN(30)×COS(30) before pressing .
See also
  • Calculator
    Calculator
    An electronic calculator is a small, portable, usually inexpensive electronic device used to perform the basic operations of arithmetic. Modern calculators are more portable than most computers, though most PDAs are comparable in size to handheld calculators.The first solid-state electronic...

  • Scientific calculator
    Scientific calculator
    A scientific calculator is a type of electronic calculator, usually but not always handheld, designed to calculate problems in science, engineering, and mathematics...

  • Programmable calculator
    Programmable calculator
    Programmable calculators are calculators that can automatically carry out a sequence of operations under control of a stored program, much like a computer. The first programmable calculators such as the IBM CPC used punched cards or other media for program storage...

  • Graphing calculator
    Graphing calculator
    A graphing calculator typically refers to a class of handheld calculators that are capable of plotting graphs, solving simultaneous equations, and performing numerous other tasks with variables...

  • Pocket computer
    Pocket computer
    A pocket computer is a small calculator-sized handheld programmable computer.This specific category of computers existed primarily in the 1980s. Manufacturers included Casio, Hewlett-Packard, Sharp, Tandy/Radio Shack and many more.The programming language was usually BASIC, but some devices...

  • Computer algebra system
    Computer algebra system
    A computer algebra system is a software program that facilitates symbolic mathematics. The core functionality of a CAS is manipulation of mathematical expressions in symbolic form.-Symbolic manipulations:...

  • Mathematical notation
    Mathematical notation
    Mathematical notation is a system of symbolic representations of mathematical objects and ideas. Mathematical notations are used in mathematics, the physical sciences, engineering, and economics...

  • Comparison of software calculators
    Comparison of software calculators
    This is a list of notable software calculators.-Immediate execution calculators :-Expression or formula calculators:-See also:* Software calculator* Calculator input methods* Formula calculator* Calculator* Graphing calculator...

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK