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
0
votes
4 answers

How to replace a number with sed command if number%7==0 in bash?

I am trying to create a file that contains all numbers between 1 and 100, each number in a single line, but with all multiples of 7 substituted by 7: ... 12 13 7 15 16 ... My current code is the following, but the sed command does not work…
riki
  • 19
  • 7
0
votes
1 answer

Distributed computing in NodeJS - Mathematical expressions

I want to make a distributed system with many nodes that compute mathematical equations. I was thinking about one "leader" as a gateway (similar to what eg. Apache does with distributed clustered websites) and many nodes. This leader will send work…
Baterka
  • 3,075
  • 5
  • 31
  • 60
0
votes
1 answer

How to solve integral in Python Gekko?

How do I include the integral of a variable x in my optimization model in Python Gekko? I found m.vsum(x) that is a summation over the time horizon but doesn't consider variable time steps. The derivative of a variable x.dt() is built-in to Gekko…
0
votes
1 answer

Python: replace function by its expression, in mathematical expression as string, with Sympy?

I have a function definition, as a string, say func_def = "f(x, y) = x + 2*y + 3". I have a mathematical expression, as a string, including that function, say expr = '2*a*b + f(b+a, 2*b)'. How can I replace, in my expression, the function by its…
0
votes
1 answer

TypeError using dictionary for math in a FOR loop -- But why?

So, the intent here is to evaluate a long series of equations that change as a function of height, and finally combine them at the very end. The end goal is to approximate an integration w/ respect to height (that part is still in the works). Right…
0
votes
0 answers

Incomplete Gamma function for negative values

I was deriving an expression for truncated gamma distribution. I derived an expression for the same which include incomplete gamma function. When I was implementing the same in matlab using the 'gammainc(x,alpha)' function, I was getting complex…
0
votes
1 answer

Mathematica Random Integer Function

Is there any way to use the RandomInteger function in Mathematica such that once an integer has been drawn, it cannot be drawn again. For example, I am looking to use the RandomInteger to draw 12 integers, between 1 & 12, such that each number is…
0
votes
1 answer

How to return true or false without using the relational operators in c?

For entertainment, suppose we want to compare two numbers of format double using the c language, and we can only use mathematical equations that use the arithmetic operators +, -, *, /, %, and fabs() and pow() to check equal to (==), less than (<),…
Bryon Gloden
  • 316
  • 1
  • 12
0
votes
1 answer

How to find tens/ones digit of two different numbers regardless of their length

sorry if this is the wrong place for this question or anything. I picked up a book on python and I'm trying to learn the basics by myself right now. My question is, if I'm given two different numbers, is there a way I can find the tens and ones…
0
votes
0 answers

Print a mathematical expression on a bitmap in c

I want my program to read a mathematical expression from standard input and print a bitmap with the expression formatted similarly to how Latex does this. Input is limited to simple expressions, that is, consisting of arithmetic operators,…
TGR
  • 3
  • 2
0
votes
1 answer

How to find if X can be represented as the summation any Y distinct positive integers?

For example if X= 10 , Y= 3 2,3,5 and 1,4,6 are possible However for Y=10 This is not possible as we know we can't represent 10 as sum of 10 distinct positive integers. Is there a more specific way to get the results?
Ankit Dwivedi
  • 95
  • 1
  • 1
  • 9
0
votes
1 answer

Easy way to evaluate long mathematical expressions in CLIPS rule based programming language

Is there a way to evaluate long expressions in CLIPS rule based programming language. I know how to evaluate single/simple expressions such as +, -, *, /, etc. (+ 3 5)=>(3+5)=8 Is there an easy way to evaluate an expression like 10+4*19-35/12 in…
Eswar
  • 1,201
  • 19
  • 45
0
votes
1 answer

How to input continuation '...' in Matheamtica

I am trying to compute an equation x = (a/(1+r)^1) + (a/(1+r)^2) + (a/(1+r)^3) ... (to infinity); (or to some point like ... +(a/(1+r)^10) How to input those dots which matheamtica can understand? Also, how can it, using same or somewhat similar…
jawad mansoor
  • 465
  • 1
  • 5
  • 9
0
votes
2 answers

Solve basic mathematical operations in python 3

I'm trying to develop a simple python method that will allow me to compute basic mathematical operations. The point here is that I can't use eval(), exec() or any other functions that evaluate python statemets, so I have to do it manually. Up to…
enon97
  • 11
  • 7
0
votes
1 answer

Postfix calculator in Cython

. Hi. I'm trying to develop a postfix calculator in Cython, translated from a working Numpy version. It is my first attempt. The calculator function gets the postfix expression in a list and the samples matrix. Then, it must return the calculated…