Questions tagged [equation]

A statement that the values of two expressions are equal indicated by the sign = .

A statement that the values of two s are equal indicated by the sign =.

1925 questions
21
votes
3 answers

General - Is there a way to calculate an average based off of an existing average and given new parameters for the resulting average?

Lets say, we're calculating averages of test scores: Starting Test Scores: 75, 80, 92, 64, 83, 99, 79 Average = 572 / 7 = 81.714... Now given 81.714, is there a way to add a new set of test scores to "extend" this average if you don't know the…
thepip3r
  • 2,855
  • 6
  • 32
  • 38
21
votes
5 answers

Calculate the position of an accelerating body after a certain time

How do I calculate the position of an accelerating body (e.g. a car) after a certain time (e.g. 1 second)? For a moving body that it not accelerating, it is a linear relationship, so I presume for an accelerating body it involves a square…
Iain
  • 9,432
  • 11
  • 47
  • 64
20
votes
5 answers

Algebra equation parser for java

I need a library to be able to parse an equation an give me the result giving the inputs. For example something like this: String equation = "x + y + z"; Map vars = new HashMap(); vars.add("x", 2); vars.add("y",…
Alfredo Osorio
  • 11,297
  • 12
  • 56
  • 84
19
votes
3 answers

Calculating opacity value mathematically

How is opacity calculated mathematically? There is opacity value in Photoshop, CSS etc. Actually this opacity is the transparent behavior of a layer. That we all know. But how is it calculated mathematically? Is there any equation to calculate…
spider
  • 320
  • 1
  • 2
  • 10
17
votes
6 answers

The shortest path between two integers by adding or subtracting

Here's the description of this problem: You are given two integers a and b. You want to find the shortest sequence of operations necessary to transform a into b, where at each step you are allowed to add or subtract 5, 7, or 12. For example, if…
Ivan
  • 766
  • 6
  • 17
16
votes
5 answers

Mathematical equation manipulation in Python

I want to develop a GUI application which displays a given mathematical equation. When you click upon a particular variable in the equation to signify that it is the unknown variable ie., to be calculated, the equation transforms itself to evaluate…
Leafy
  • 359
  • 2
  • 3
  • 7
15
votes
1 answer

Equation Parsing Library C++

I'm sure there must be something like this somewhere but I can't seem to find anything useful on here or Google. I had hoped Boost might have something but alas not. What I'm after is a lightweight library that can take a string from the user, for…
Dan
  • 12,857
  • 7
  • 40
  • 57
15
votes
5 answers

Plot equation showing a circle

The following formula is used to classify points from a 2-dimensional space: f(x1,x2) = np.sign(x1^2+x2^2-.6) All points are in space X = [-1,1] x [-1,1] with a uniform probability of picking each x. Now I would like to visualize the circle that…
Elyakim
  • 511
  • 1
  • 6
  • 12
15
votes
4 answers

Typesetting LaTeX fraction terms to be larger in an equation

I have the following formula in LaTeX, based on Fisher's Exact Test. (NOTE: requires the use of the amsmath package for \binom.) \begin{equation} P(i,j) = \sum_{x=|N(V_i) \cap V_j|}^{\min\{|V_j|, |N(V_i)|} \frac{ \binom{|V_j|}{x} \binom{|V -…
gotgenes
  • 38,661
  • 28
  • 100
  • 128
15
votes
8 answers

How to Solve Equations with java?

I have three equations like the following ones: x + y + z = 100; x + y - z = 50; x - y - z = 10; How can I find the values of x, y, and z with Java? String equation1="x+y+z=100;"; String equation2="x+y-z=50;"; String equation3="x-y-z=10;"; int[]…
Cong De Peng
  • 321
  • 1
  • 4
  • 11
13
votes
3 answers

Haskell: Equation Expander 1+(1+(1+(1+(…))))=∞

Does there exist a equation expander for Haskell? Something like foldr.com: 1+(1+(1+(1+(…))))=∞ I am new to Haskell I am having trouble understanding why certain equations are more preferable than others. I think it would help if I could see the…
user295190
13
votes
3 answers

How can I split a string into tokens?

If I have a string 'x+13.5*10x-4e1' how can I split it into the following list of tokens? ['x', '+', '13', '.', '5', '*', '10', 'x', '-', '4', 'e', '1'] Currently I'm using the shlex module: str = 'x+13.5*10x-4e1' lexer =…
Martin Thetford
  • 133
  • 1
  • 1
  • 6
12
votes
5 answers

Safely evaluate simple string equation

I'm writing a program in which an equation is inputted as a string, then evaluated. So far, I've come up with this: test_24_string = str(input("Enter your answer: ")) test_24 = eval(test_24_string) I need both a string version of this equation and…
Aamri
  • 139
  • 1
  • 1
  • 7
12
votes
2 answers

What are the state-of-art methods for solving functional equations?

Suppose that you want to find a λ-calculus program, T, that satisfies the following equations: (T (λ f x . x)) = (λ a t . a) (T (λ f x . (f x))) = (λ a t . (t a)) (T (λ f x . (f (f x)))) = (λ a b t . (t a b)) (T (λ f x . (f (f…
MaiaVictor
  • 51,090
  • 44
  • 144
  • 286
12
votes
6 answers

RMSE (root mean square deviation) calculation in R

I have numeric feature observations V1 through V12 taken for a target variable Wavelength. I would like to calculate the RMSE between the Vx columns. Data format is below. Each variable "Vx" is measured at a 5-minute interval. I would like to…
Vicki1227
  • 489
  • 4
  • 6
  • 19