Symbolic computation refers to the transformation of mathematical expressions in symbolic form. Mathematical expressions may also be transformed in numeric form; however, numeric form is less precise than symbolic. Transforming mathematical expressions in symbolic form is more precise than numeric form, because the numeric form may be calculated in floating-point computation, which has limited precision. Typical operations in symbolic computation include differentiation and integration, linear algebra and matrix calculus, operations with polynomials, or the simplification of algebraic expressions.
Because of the resources required for symbolic computation, software may be used to perform symbolic computation. Software approaches range from programs designed specifically for symbolic computation to programming languages designed with special libraries for performing symbolic computation. Programs or systems in this area which provide a language interface are called Computer Algebra Systems (CASes).
CASes are typically designed for applications in theoretical physics or mathematics. These systems may be used for applications where straightforward, but tedious or lengthy calculations are required.
Described herein are implementations of various technologies for performing symbolic computations on a mathematical expression. The mathematical expression may be converted to a tree structure. The tree structure may contain parent nodes and child nodes. The parent nodes may be mathematical operations to be performed on the parent node's child nodes. Symbolic computations, such as a polynomial expand, may be performed using tree operations on the tree-structured mathematical expression. Tree operations may manipulate the position and/or content of the parent nodes and the child nodes, thereby resulting in changes to the mathematical expression represented by the modified tree structure.
The claimed subject matter is not limited to implementations that solve any or all of the noted disadvantages. Further, the summary section is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description section. The summary section is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
In general, one or more implementations of various technologies described herein are directed performing symbolic computations on a mathematical expression. The various implementations will be described in more detail in the following paragraphs.
Implementations of various technologies described herein may be operational with numerous general purpose or special purpose computing system environments or configurations. Examples of well known computing systems, environments, and/or configurations that may be suitable for use with the various technologies described herein include, but are not limited to, personal computers, server computers, hand-held or laptop devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like.
The various technologies described herein may be implemented in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The various technologies described herein may also be implemented in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network, e.g., by hardwired links, wireless links, or combinations thereof. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The computing system 100 may include a central processing unit (CPU) 21, a system memory 22 and a system bus 23 that couples various system components including the system memory 22 to the CPU 21. Although only one CPU is illustrated in
The computing system 100 may further include a hard disk drive 27 for reading from and writing to a hard disk, a magnetic disk drive 28 for reading from and writing to a removable magnetic disk 29, and an optical disk drive 30 for reading from and writing to a removable optical disk 31, such as a CD ROM or other optical media. The hard disk drive 27, the magnetic disk drive 28, and the optical disk drive 30 may be connected to the system bus 23 by a hard disk drive interface 32, a magnetic disk drive interface 33, and an optical drive interface 34, respectively. The drives and their associated computer-readable media may provide nonvolatile storage of computer-readable instructions, data structures, program modules and other data for the computing system 100.
Although the computing system 100 is described herein as having a hard disk, a removable magnetic disk 29 and a removable optical disk 31, it should be appreciated by those skilled in the art that the computing system 100 may also include other types of computer-readable media that may be accessed by a computer. For example, such computer-readable media may include computer storage media and communication media.
Computer storage media may include volatile and non-volatile, and removable and non-removable media implemented in any method or technology for storage of information, such as computer-readable instructions, data structures, program modules or other data. Computer storage media may further include RAM, ROM, erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other solid state memory technology, CD-ROM, digital versatile disks (DVD), or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by the computing system 100.
Communication media may embody computer readable instructions, data structures, program modules or other data in a modulated data signal, such as a carrier wave or other transport mechanism and may include any information delivery media. The term “modulated data signal” may mean a signal that has one or more of its characteristics set or changed in such a manner as to encode information in the signal. By way of example, and not limitation, communication media may include wired media such as a wired network or direct-wired connection, and wireless media such as acoustic, RF, infrared and other wireless media. Combinations of the any of the above may also be included within the scope of computer readable media.
A number of modules may be stored on the hard disk, magnetic disk 29, optical disk 31, ROM 24 or RAM 25, including an operating system 35, one or more application programs 36, a symbolic computation module 60, a tree structure equation 38, and a database system 55. The operating system 35 may be any suitable operating system that may control the operation of a networked personal or server computer, such as Windows® XP, Mac OS® X, Unix-variants (e.g., Linux® and BSD®), and the like.
The tree structure equation 38 may include a mathematical expression that is represented in a tree-like structure. Specifically, the tree structure equation 38 may include parent nodes and child nodes that contain mathematical operations and mathematical expressions of the mathematical expression, respectively.
The symbolic computation module 60 may convert a mathematical expression to the tree structure equation 38. Further, the symbolic computation module 60 may perform symbolic computations on the mathematical expression by performing tree operations on the tree structured equation 38. The symbolic computation module 60 and the tree structured equation 38 will be described in more detail with reference to
A user may enter commands and information into the computing system 100 through input devices such as a keyboard 40 and pointing device 42. Other input devices may include a microphone, joystick, game pad, satellite dish, scanner, or the like. These and other input devices may be connected to the CPU 21 through a serial port interface 46 coupled to system bus 23, but may be connected by other interfaces, such as a parallel port, game port or a universal serial bus (USB). A monitor 47 or other type of display device may also be connected to system bus 23 via an interface, such as a video adapter 48. In addition to the monitor 47, the computing system 100 may further include other peripheral output devices, such as speakers and printers.
Further, the computing system 100 may operate in a networked environment using logical connections to one or more remote computers, such as a remote computer 49. The remote computer 49 may be another personal computer, a server, a router, a network PC, a peer device or other common network node. Although the remote computer 49 is illustrated as having only a memory storage device 50, the remote computer 49 may include many or all of the elements described above relative to the computing system 100. The logical connections may be any connection that is commonplace in offices, enterprise-wide computer networks, intranets, and the Internet, such as local area network (LAN) 51 and a wide area network (WAN) 52.
When using a LAN networking environment, the computing system 100 may be connected to the local network 51 through a network interface or adapter 53. When used in a WAN networking environment, the computing system 100 may include a modem 54, wireless router or other means for establishing communication over a wide area network 52, such as the Internet. The modem 54, which may be internal or external, may be connected to the system bus 23 via the serial port interface 46. In a networked environment, program modules depicted relative to the computing system 100, or portions thereof, may be stored in a remote memory storage device 50. It will be appreciated that the network connections shown are exemplary and other means of establishing a communications link between the computers may be used.
It should be understood that the various technologies described herein may be implemented in connection with hardware, software or a combination of both. Thus, various technologies, or certain aspects or portions thereof, may take the form of program code (i.e., instructions) embodied in tangible media, such as floppy diskettes, CD-ROMs, hard drives, or any other machine-readable storage medium wherein, when the program code is loaded into and executed by a machine, such as a computer, the machine becomes an apparatus for practicing the various technologies. In the case of program code execution on programmable computers, the computing device may include a processor, a storage medium readable by the processor (including volatile and non-volatile memory and/or storage elements), at least one input device, and at least one output device.
One or more programs that may implement or utilize the various technologies described herein may use an application programming interface (API), reusable controls, and the like. Such programs may be implemented in a high level procedural or object oriented programming language to communicate with a computer system. However, the program(s) may be implemented in assembly or machine language, if desired. In any case, the language may be a compiled or interpreted language, and combined with hardware implementations.
At step 210, the symbolic computation module 60 may convert a mathematical expression to a tree structure equation 38. As stated previously, the tree structure equation 38 may include child nodes and parent nodes that represent mathematical expressions and mathematical operations, respectively. Each child node may be in a hierarchical relationship with one parent node.
The mathematical operation of the parent node may be performed on the child nodes for the parent node in a specified order. The specified order may be represented in the sequence of the child nodes that contain the mathematical expressions.
For example,
At step 220, the symbolic computation module 60 may perform a first symbolic computation on the mathematical expression. The symbolic computation may be performed by manipulating the parent nodes, child nodes or both in the tree structure equation 38.
Tree operations may be used to manipulate the parent nodes and the child nodes. The tree operations are referred to herein individually as, SWAP CHILD, EXPAND CHILD, REPLACE CHILD, ROTATE, INSERT, ADD, and REMOVE, each of which will be described with reference to
Symbolic computations may be described in levels of complexity: low and high. Symbolic computations with a low level of complexity may be performed by using one or more of the tree operations. The low level symbolic computations may include operations, such as, a polynomial expansion operation, a rational together operation, an apart operation, or a partial fraction operation.
One example of a polynomial expansion operation is the expansion of a product of sums. In a polynomial expansion of a product of sums, the product of sums is expressed as a sum of products by using the fact that multiplication distributes over addition. Expansions of polynomials are obtained by multiplying together their factors, which results in a sum of terms with variables raised to different degrees. For example, a polynomial expansion of the mathematical expression:
X*(A+B)
results in:
(X*A)+(X*B)
The rational together operation may put terms in a sum over a common denominator. For example, a rational together of:
(A/B)+D
results in:
(A+DB)/B
The rational together operation may also cancel common factors in the numerator and denominator of the result.
The apart operation may distribute the fraction parts according to a sum symbol. No operations will be executed. The following is an example of the apart operation:
The partial fraction operation may include a partial fraction decomposition or a partial fraction expansion. The partial fraction operation may reduce the degree of either the numerator or the denominator of a rational function. The outcome of partial fraction expansion expresses that function as a sum of fractions, where the denominator of each term is a power of an irreducible (not factorable) polynomial, and the numerator is a polynomial of smaller degree than that irreducible polynomial. The following is an example of the partial fraction expansion:
At step 230, the symbolic computation module 60 may perform a second symbolic computation on the mathematical expression. As stated previously, the symbolic computations may include both low and high level computations. The second symbolic computation may be one of the high level symbolic computations.
The high level symbolic computations may be performed through the use of one or more low level symbolic computations, i.e., the first symbolic computation. The high level symbolic computations may include operations, such as, a factorization operation, a greatest common divisor operation, or a resultant computation operation.
In mathematics, factorization or factoring is the decomposition of an object (for example, a number, a polynomial, or a matrix) into a product of other objects, or factors, which when multiplied together give the original. For example, the number 15 factors into primes as 3×5, and the polynomial x2−4 factors as (x−2)*(x+2). In all cases, a product of simpler objects is obtained.
In mathematics, the greatest common divisor operation (GCD), sometimes known as the greatest common factor (GCF) or highest common factor (HCF), of two non-zero integers, is the largest positive integer that divides both numbers without remainder. This notion can be extended to polynomials.
In mathematics, the resultant of two monic polynomials P and Q over a field k is defined as the product of the differences of their roots, where x and y take on values in the algebraic closure of k.
For non-monic polynomials with leading coefficients p and q, respectively, the above product is multiplied by:
Pdegree of Q(Qdegree of P)
The tree structure 310 may represent the following equation:
A+B
The SWAP CHILD operation may swap the specified order in which the mathematical operation is performed on two of the child nodes. In this example, the “A” and “B” child nodes may be swapped. Accordingly, the tree structure 320 represents a new equation with the specified order changed after the swap:
B+A
For example, the tree structure 410 may represent the following equation:
A+(B+C)
It should be noted that the subscripts, 1 and 2 on the add operations are provided merely for the purpose of identification, and do not indicate a difference between the two addition operations. An EXPAND CHILD operation on the parent node, “ADD2,” may replace the parent node having the “ADD2” operation with the parent node's two child nodes, “A” and “B.” As such, the tree structure 420 may result that represents the following equation:
A+B+C
For example, the tree structure 510 may represent the equation:
A+B
If the REPLACE CHILD tree operation were to replace the child node labeled, “B” with a mathematical expression, such as:
C/D,
The tree structure 520 may result, which represents the equation:
A+C/D
The ROTATE tree operation may swap positions in the tree structure 610 for a parent node, and the parent node's parent node (grandparent node). Further, a child node of the parent node may be selected based on a right or left direction from the parent node to the grandparent node. If the grandparent is to the right of the parent node, the left child may be selected; otherwise, the right child may be selected. The selected child node may then be moved to become a child node of the grandparent node
For example, the tree structure 610 represents the equation:
[(A−B)*C]+D
A rotate on the parent node labeled, “SUBTRACT,” may be performed as follows. The parent node labeled, “SUBTRACT,” may switch positions with “SUBTRACT's” parent node, labeled, “MULTIPLY.”
Then, one of the child nodes of the parent node, “SUBTRACT,” may be selected based on a direction from the parent node, “SUBTRACT,” to the grandparent node, “MULTIPLY.” Because the grandparent node is to the right of the parent node, the left child node of the parent node, labeled, “A,” may be moved to the grandparent node.
The resulting tree structure 620 may represent the following equation:
[(A*C)−B]+D
The INSERT tree operation may add a new child node to one of the parent nodes. Further, the point of insertion may be specified, thereby modifying the specified order that the mathematical operation is performed. Specifically, the newly inserted child node may be performed before at least one of the other child nodes of the parent node to which the new child node is added.
For example, the tree structure 710 may represent the following equation:
A+B
A new child node labeled, “C,” may be inserted before the child node labeled, “B.” The INSERT results in the tree structure 720, which may represent the following equation:
A+C+B
For example, the tree structure 810 may represent the equation:
A+B
If a new child node labeled, “C,” is added to the parent node labeled, “ADD,” the tree structure 820 may result. The tree structure 820 may represent the equation:
A+B+C
Note that the new child node is positioned last in the sequence of the child nodes. The sequence represented may indicate that the specified order of the ADD operation is performed on the new child node last.
For example, the tree structure 910 may represent the following equation:
A+C+B
A REMOVE tree operation may be performed on the child node labeled, “C,” giving the tree structure 920, which may represent the following equation:
A+B
As shown, the tree structure 1010 may represent the following equation:
A*(B+C)
A polynomial expansion may produce the following equation:
(A*B)+(A*C)
In one implementation, a ROTATE tree operation may be performed on the tree structure 1010, giving the tree structure 1020. A REPLACE tree operation may then be performed, replacing the child node labeled, “B,” with the mathematical expression, “A*B,” giving the tree structure 1030. The tree structure 1030 may represent the following equation:
(A*B)+(A*C),
which is the result of the polynomial expansion as described above. The combination of the ROTATE and REPLACEMENT tree operations may be used to perform the other symbolic computations described above. The polynomial expansion operation is used merely as an example and is not intended to limit implementations of various technologies described herein.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.