Questions tagged [mathematical-expressions]

In mathematics, an expression is a finite combination of symbols that is well-formed according to rules that depend on the context. Symbols can designate numbers (constants), variables, operations, functions, and other mathematical symbols, as well as punctuation, symbols of grouping, and other syntactic symbols.

Strings of symbols that violate the rules of syntax are not well-formed and are not valid mathematical expressions. For example:

would not be considered a mathematical expression but only a meaningless jumble.

In algebra an expression may be used to designate a value, which might depend on values assigned to variables occurring in the expression; the determination of this value depends on the semantics attached to the symbols of the expression.

These semantic rules may declare that certain expressions do not designate any value; such expressions are said to have an undefined value, but they are well-formed expressions nonetheless.

In general the meaning of expressions is not limited to designating values; for instance, an expression might designate a condition, or an equation that is to be solved, or it can be viewed as an object in its own right that can be manipulated according to certain rules. Certain expressions that designate a value simultaneously express a condition that is assumed to hold, for instance those involving the operator to designate an internal direct sum.

Being an expression is a syntactic concept; although different mathematical fields have different notions of valid expressions, the values associated to variables does not play a role. See formal language for general considerations on how expressions are constructed, and formal semantics for questions concerning attaching meaning (values) to expressions.

261 questions
5
votes
4 answers

How to evaluate a mathematical expression saved in nvarchar variable in SQL Server

i want to evaluate a mathematical expression saved in a variable in sql server i google this a lot and found 3 solution but not applicable in my scenario 1- this solution cannot be executed inside a function but i need it inside a function declare…
Mariam
  • 533
  • 2
  • 12
  • 22
5
votes
2 answers

Mathematical expression (string) to number in Java

I'm trying to find something like Java Embedding Plugin (JEP) that can evaluate a mathematical formula (string) and give back the answer. But it should also calculate a variable, for example: (25+36+x)*2 = 25 should give: x = -11 A little like…
Berty
  • 1,081
  • 1
  • 18
  • 49
5
votes
4 answers

FullSimply Inequalities and then rearranging them in Mathematica 7

I am using Mathematica 7 in the notebook interface and I want to rearrange an inequality so that I get a certain variable on one side. For eg. FullSimplify[x^3+L+r>3x^3+2r] Gives L > r + 2 x^3 However, I want : r < L-2x^3 Is there anyway we can…
skr
  • 452
  • 6
  • 21
5
votes
2 answers

Non-commutative sympify (or simplify)

I would like to be able to simplify mathematical expressions from a string in Python. There are several "commutative" ways of doing it. Is there a non-commutative function for that? I know that sympify from sympy can do some non-commutative jobs,…
5
votes
3 answers

Is there a way to override LaTeX's errors about double subscripts and superscripts?

Minor point about LaTeX that bothers me. When one writes a^b^c, a_b_c or a'^b in math mode, LaTeX gives an error message complaining about multiple super/subscripts. This is particularly annoying after replacing a string containing a…
Dmitry Vaintrob
  • 153
  • 1
  • 1
  • 5
5
votes
2 answers

Writing variables as subscripts in math mode

I am trying to plot some data, using a for loop to plot distributions. Now I want to label those distributions according to the loop counter as the subscript in math notation. This is where I am with this at the moment. import matplotlib.pyplot as…
Sahil M
  • 1,790
  • 1
  • 16
  • 31
5
votes
5 answers

Evaluating Mathematical Expressions using Lua

In my previous question I was looking for a way of evaulating complex mathematical expressions in C, most of the suggestions required implementing some type of parser. However one answer, suggested using Lua for evaluating the expression. I am…
hhafez
  • 38,949
  • 39
  • 113
  • 143
4
votes
3 answers

How to make a logical selection using calculations in c?

I am helping my daughter with an intro to c programming assignment, and her homework contains a simple menu like this: Please choose an option below: ------------------------------ 1. Linear time 2. Logarithmic time 3. Exponential time Now, usually…
Bryon Gloden
  • 316
  • 1
  • 12
4
votes
1 answer

Mixing expression, plain text and newline in ggplot2 expression

I am trying to create some labels/stickers using ggplot2. I am pulling the text for the labels from a source and tyring to plot. I am able to do that as follows: labtxt1 <- c("This text should be bold", "This text should also be bold", "Another…
Crops
  • 5,024
  • 5
  • 38
  • 65
4
votes
2 answers

Cannot display Unicode Characters (like λ) in PDF output of Jupyter

I'm using Julia in a jupyter notebook. I want to generate a pdf for the results of my work. However, when generating the pdf, the λ of the mathematical expression λ=3 is lost so that the output in the pdf is =3. Here is the jupyter notebook…
ecjb
  • 5,169
  • 12
  • 43
  • 79
4
votes
2 answers

Why sympy cannot calculate fraction power formula like (6-x*x)**(1.5)?

I used sympy to calculate some integral as follows. #Calculate Calculus import sympy x = sympy.Symbol('x') f = (6-x*x)**(1.5) f.integrate() This will fail and throw excepiton like: ValueError: gamma function pole It works fine if I just use an…
Pythoner
  • 5,265
  • 5
  • 33
  • 49
4
votes
2 answers

Efficient method for convolution like sum evaluation

Problem Given N 3-dimensional points which are {$p_1,p_2,..,p_n$} where $p_i = (x_i,y_i,z_i) $ . I have to find the value of the formula for some given constant integers P, Q, R, S. all numbers are between 1 and M ( = 100). I need an efficient…
4
votes
5 answers

Defining a mathemetical function and evaluate within a C/C++ function

The pseudo-code below depicts a computation I want to do. The idea is designing a C/C++ function that takes any mathematical function of x and evaluates the sum of the first N terms. function(x) could be any function e.g. 2x-1 , 2x , 1/x , etc . x…
Walker
  • 323
  • 1
  • 12
4
votes
1 answer

Parsec-Haskell, formatting parse errors

I am developing a simple calculator that takes one line of input, parses it using parsec and then processes it. I want to make the parsec parse-error messages smaller. They include position info which is not necessary for a one line input. I've…
user2388535
4
votes
2 answers

Fixing the Rebol3 example calculator to use normal math operator precedence

In the example calculator: REBOL [title: "Calculator"] do %r3-gui.r3 stylize [ btn: button [ facets: [init-size: 50x50] actors: [on-action:[set-face f join get-face f get-face face]] ] ] view [ hgroup [ f: field…
Kev
  • 15,899
  • 15
  • 79
  • 112
1
2
3
17 18