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
2
votes
2 answers

Adding Conditionals & Functions to a Math Parser

I have a binary tree based mathematical expression parser I built, which works great for 'normal' math, like: (3.5 * 2) ^ 1 / (1 << 6). however, I would like to expand it a little to add a ternary selection operator, mirroring the one from C: {expr}…
Necrolis
  • 25,836
  • 3
  • 63
  • 101
2
votes
2 answers

Control if a String is a mathematical expression

I'm searching a way to check if a String is a mathematical expression as i.e. x + y -sin(1) * 99k i don't wanna evaluate the expression, but understand if the String is written in the right way. There is some Java library for do that? UPDATE: I'm…
Tirrel
  • 778
  • 2
  • 7
  • 23
2
votes
2 answers

Modular arithmetic (a*b/e)%m?

Is there a modular expression possible for following : ((a*b)/e)%m For ex : (a*b*c)%m = ((a%m)*(b%m)*(c%m))%m
Akash Rana
  • 3,685
  • 3
  • 19
  • 28
2
votes
1 answer

How to search and replace in mathematica?

I'm looking to learn how to search through a polynomial and replace all points P[x,y] that are contained within a list of finite points {P[a,b], P[c,d],..., P[x,y]} with a term such as (q+ab) and replace all points, P[a,b] that are not contained in…
2
votes
2 answers

How to do part-of-speech tagging of texts, containing mathematical expressions?

The goal is a syntactic parsing of scientific texts. And first I need to make part-of-speech tagging of sentences of such texts. Texts are from arxiv.org. So they are originally in LaTeX. When extracting text from LaTeX documents, math expressions…
kseniyam
  • 95
  • 1
  • 5
2
votes
1 answer

Plot discontinuous mathematical expression?

I am trying to plot mathematical functions and use the CoreGraphics framework. I am calculating a path by manually calculating the y-coordinate of a user defined mathematical function. To draw the function I have included a simplified version of…
user610246
  • 732
  • 1
  • 7
  • 11
2
votes
2 answers

shunting yard algorithm with trigonometric functions

I am working on implementing shunting yard algorithm in C#. Although it parses mathematical expressions with symbols( + , * - / and ^) pretty well.But for some reason it is not working for sine cosine functions . Like for example if I try to…
InspiredCoder
  • 394
  • 6
  • 22
2
votes
5 answers

Check if a string is a mathematical expression or not?

I am trying to write a method in Java that accepts a string as an argument. Now this string may be a mathematical expression or it may be just an ordinary string. I have to evaluate it only if it is a mathematical expression and leave it alone if it…
Aswin Parthasarathy
  • 605
  • 1
  • 8
  • 17
1
vote
1 answer

How to get a proper imathas link for a given mathematical expression string?

For example for a string x + 1/y I want to generate this url with expression: http://www.imathas.com/cgi-bin/mimetex.cgi?\displaystyle\blue{x}%2B\frac{{1}}{{y}} Is there any tool doing this job in C#?
Łukasz Wiatrak
  • 2,747
  • 3
  • 22
  • 38
1
vote
1 answer

Plots not rendering properly on an implicit plot (python)

I am trying to plot two curves and then mark their intersection with a vertical line from the x-axis to the point of intersection. Sometimes the line will generate other times it will not unless I show the plot and then append it as well. To see…
Bountifull
  • 13
  • 2
1
vote
1 answer

How to get the mid of 2 int32 number elegantly without overflow?

In some conditions like Segment Tree or Binary Search, I have to get the average value of 2 number. An easy solution is mid = (a + b) / 2. But when it comes to a and b have the same plus-minus signs, The a + b thing will overflow. For example,…
Cary Zheng
  • 95
  • 7
1
vote
0 answers

How do exchanges calculate EMA in real-time?

I calculated the EMA of some candles,but i don't know how to calculate the EMA for a unclosed candle i came up with this idea but it doesn't correspond to one in the exchange n = EMA_lenght EMA_FOR_UNCLOSED_CANDLE = Close*(2/(n+1))+last_EMAn *…
1
vote
1 answer

How will Comsol use the expression "0 10^range(2, 0.1, 7.5)"?

I am facing an issue with the range function. How will the following expression be used?
SUGANTH
  • 13
  • 1
  • 5
1
vote
3 answers

Interpreting formulas with ΣΣ (two sigma) in Python

Consider the function f(x,y) that equals two sigma (ΣΣ) where i ranges from 1 to 10 and (first sigma) and j ranges from 1 to 10 (second sigma) of the quantity {ix^2 + jy^3) I believe the first sigma would be an inner loop and the second sigma an…
1
vote
1 answer

How do I add numbers to each subset in Wolfram mathematica?

Say I have a deck of 52 cards. I now remove two cards from the deck, say it is Diamond 2 and 4. I now create a subset {5} meaning I print every 5 card combination of the 50 cards I have left. How do I now add back both the diamond 2 and 4 into each…