LaTeX to CAS translator
This mockup demonstrates the concept of TeX to Computer Algebra System (CAS) conversion.
The demo-application converts LaTeX functions which directly translate to CAS counterparts.
Functions without explicit CAS support are available for translation via a DRMF package (under development).
The following LaTeX input ...
{\displaystyle \mathcal{K}_k(x; n,q) = \mathcal{K}_k(x) = \sum_{j=0}^{k}(-1)^j (q-1)^{k-j} \binom {x}{j} \binom{n-x}{k-j}, \quad k=0,1, \ldots, n.}
... is translated to the CAS output ...
Semantic latex: \mathcal{K}_k(x; n,q) = \mathcal{K}_k(x) = \sum_{j=0}^{k}(-1)^j (q-1)^{k-j} \binom {x}{j} \binom{n-x}{k-j}, \quad k=0,1, \ldots, n
Confidence: 0
Mathematica
Translation: Subscript[K, k][x ; n , q] == Subscript[K, k][x] == Sum[(- 1)^(j)*(q - 1)^(k - j)*Binomial[x,j]*Binomial[n - x,k - j], {j, 0, k}, GenerateConditions->None]
Information
Sub Equations
- Subscript[K, k][x ; n , q] = Subscript[K, k][x]
- Subscript[K, k][x] = Sum[(- 1)^(j)*(q - 1)^(k - j)*Binomial[x,j]*Binomial[n - x,k - j], {j, 0, k}, GenerateConditions->None]
Free variables
- k
- n
- q
- x
Constraints
- k == 0 , 1 , \[Ellipsis], n
Symbol info
- Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
Tests
Symbolic
Numeric
SymPy
Translation: Symbol('{K}_{k}')(x ; n , q) == Symbol('{K}_{k}')(x) == Sum((- 1)**(j)*(q - 1)**(k - j)*binomial(x,j)*binomial(n - x,k - j), (j, 0, k))
Information
Sub Equations
- Symbol('{K}_{k}')(x ; n , q) = Symbol('{K}_{k}')(x)
- Symbol('{K}_{k}')(x) = Sum((- 1)**(j)*(q - 1)**(k - j)*binomial(x,j)*binomial(n - x,k - j), (j, 0, k))
Free variables
- k
- n
- q
- x
Constraints
- k == 0 , 1 , null , n
Symbol info
- Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
Tests
Symbolic
Numeric
Maple
Translation: K[k](x ; n , q) = K[k](x) = sum((- 1)^(j)*(q - 1)^(k - j)*binomial(x,j)*binomial(n - x,k - j), j = 0..k)
Information
Sub Equations
- K[k](x ; n , q) = K[k](x)
- K[k](x) = sum((- 1)^(j)*(q - 1)^(k - j)*binomial(x,j)*binomial(n - x,k - j), j = 0..k)
Free variables
- k
- n
- q
- x
Constraints
- k = 0 , 1 , .. , n
Symbol info
- Function without DLMF-Definition. We keep it like it is (but delete prefix \ if necessary).
Tests
Symbolic
Numeric
Dependency Graph Information
Includes
Description
- Kravchuk polynomial
- prime power
- positive integer
Complete translation information:
{
"id" : "FORMULA_835dfbc367f2ff51a494b24a3cb81809",
"formula" : "\\mathcal{K}_k(x; n,q) = \\mathcal{K}_k(x) = \\sum_{j=0}^{k}(-1)^j (q-1)^{k-j} \\binom {x}{j} \\binom{n-x}{k-j}, \\quad k=0,1, \\ldots, n",
"semanticFormula" : "\\mathcal{K}_k(x; n,q) = \\mathcal{K}_k(x) = \\sum_{j=0}^{k}(-1)^j (q-1)^{k-j} \\binom {x}{j} \\binom{n-x}{k-j}, \\quad k=0,1, \\ldots, n",
"confidence" : 0.0,
"translations" : {
"Mathematica" : {
"translation" : "Subscript[K, k][x ; n , q] == Subscript[K, k][x] == Sum[(- 1)^(j)*(q - 1)^(k - j)*Binomial[x,j]*Binomial[n - x,k - j], {j, 0, k}, GenerateConditions->None]",
"translationInformation" : {
"subEquations" : [ "Subscript[K, k][x ; n , q] = Subscript[K, k][x]", "Subscript[K, k][x] = Sum[(- 1)^(j)*(q - 1)^(k - j)*Binomial[x,j]*Binomial[n - x,k - j], {j, 0, k}, GenerateConditions->None]" ],
"freeVariables" : [ "k", "n", "q", "x" ],
"constraints" : [ "k == 0 , 1 , \\[Ellipsis], n" ],
"tokenTranslations" : {
"K" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary)."
}
},
"numericResults" : {
"overallResult" : "SKIPPED",
"numberOfTests" : 0,
"numberOfFailedTests" : 0,
"numberOfSuccessfulTests" : 0,
"numberOfSkippedTests" : 0,
"numberOfErrorTests" : 0,
"wasAborted" : false,
"crashed" : false,
"testCalculationsGroups" : [ ]
},
"symbolicResults" : {
"overallResult" : "SKIPPED",
"numberOfTests" : 0,
"numberOfFailedTests" : 0,
"numberOfSuccessfulTests" : 0,
"numberOfSkippedTests" : 0,
"numberOfErrorTests" : 0,
"crashed" : false,
"testCalculationsGroup" : [ ]
}
},
"SymPy" : {
"translation" : "Symbol('{K}_{k}')(x ; n , q) == Symbol('{K}_{k}')(x) == Sum((- 1)**(j)*(q - 1)**(k - j)*binomial(x,j)*binomial(n - x,k - j), (j, 0, k))",
"translationInformation" : {
"subEquations" : [ "Symbol('{K}_{k}')(x ; n , q) = Symbol('{K}_{k}')(x)", "Symbol('{K}_{k}')(x) = Sum((- 1)**(j)*(q - 1)**(k - j)*binomial(x,j)*binomial(n - x,k - j), (j, 0, k))" ],
"freeVariables" : [ "k", "n", "q", "x" ],
"constraints" : [ "k == 0 , 1 , null , n" ],
"tokenTranslations" : {
"K" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary)."
}
},
"numericResults" : {
"overallResult" : "SKIPPED",
"numberOfTests" : 0,
"numberOfFailedTests" : 0,
"numberOfSuccessfulTests" : 0,
"numberOfSkippedTests" : 0,
"numberOfErrorTests" : 0,
"wasAborted" : false,
"crashed" : false,
"testCalculationsGroups" : [ ]
},
"symbolicResults" : {
"overallResult" : "SKIPPED",
"numberOfTests" : 0,
"numberOfFailedTests" : 0,
"numberOfSuccessfulTests" : 0,
"numberOfSkippedTests" : 0,
"numberOfErrorTests" : 0,
"crashed" : false,
"testCalculationsGroup" : [ ]
}
},
"Maple" : {
"translation" : "K[k](x ; n , q) = K[k](x) = sum((- 1)^(j)*(q - 1)^(k - j)*binomial(x,j)*binomial(n - x,k - j), j = 0..k)",
"translationInformation" : {
"subEquations" : [ "K[k](x ; n , q) = K[k](x)", "K[k](x) = sum((- 1)^(j)*(q - 1)^(k - j)*binomial(x,j)*binomial(n - x,k - j), j = 0..k)" ],
"freeVariables" : [ "k", "n", "q", "x" ],
"constraints" : [ "k = 0 , 1 , .. , n" ],
"tokenTranslations" : {
"K" : "Function without DLMF-Definition. We keep it like it is (but delete prefix \\ if necessary)."
}
},
"numericResults" : {
"overallResult" : "SKIPPED",
"numberOfTests" : 0,
"numberOfFailedTests" : 0,
"numberOfSuccessfulTests" : 0,
"numberOfSkippedTests" : 0,
"numberOfErrorTests" : 0,
"wasAborted" : false,
"crashed" : false,
"testCalculationsGroups" : [ ]
},
"symbolicResults" : {
"overallResult" : "SKIPPED",
"numberOfTests" : 0,
"numberOfFailedTests" : 0,
"numberOfSuccessfulTests" : 0,
"numberOfSkippedTests" : 0,
"numberOfErrorTests" : 0,
"crashed" : false,
"testCalculationsGroup" : [ ]
}
}
},
"positions" : [ {
"section" : 1,
"sentence" : 0,
"word" : 14
} ],
"includes" : [ "q", "n" ],
"isPartOf" : [ ],
"definiens" : [ {
"definition" : "Kravchuk polynomial",
"score" : 0.722
}, {
"definition" : "prime power",
"score" : 0.6859086196238077
}, {
"definition" : "positive integer",
"score" : 0.6460746792928004
} ]
}