algebra Questions

4

For a collision algorithm I am developing, I need to find out how to reflect a line over another. Line 1: y=ax+b Line 2: y=cx+d Line 3: (a result of reflecting line 1 over line 2) y=e...
Procto asked 30/6, 2013 at 23:42

5

Solved

I would like to know if there is a straightforward algorithm for rearranging simple symbolic algebraic expressions. Ideally I would like to be able to rewrite any such expression with one variable ...
Letterpress asked 2/1, 2011 at 3:42

9

I have spent the last 5 hours searching for an answer. Even though I have found many answers they have not helped in any way. What I am basically looking for is a mathematical, arithmetic only rep...
Cirque asked 22/1, 2014 at 20:27

2

I'm trying to solve a system of equations that is a 1 Million x 1 Million square matrix and one 1 Million solution vector. To do this, I'm using np.linalg.solve(matrix, answers) but it's taking a v...
Mercurio asked 28/6, 2022 at 16:57

13

My question is: given a target RGB color, what is the formula to recolor black (#000) into that color using only CSS filters? For an answer to be accepted, it would need to provide a function (in ...
Beliabelial asked 23/3, 2017 at 3:18

6

Solved

I want to implement a logical operation that works as efficient as possible. I need this truth table: p q p → q T T T T F F F T T F F T This, according to wikipedia is called "logical implicatio...
Milla asked 21/3, 2009 at 2:55

2

I want to fit a plane to a 3D point cloud. I use a RANSAC approach, where I sample several points from the point cloud, calculate the plane, and store the plane with the smallest error. The error i...
Epicontinental asked 28/8, 2015 at 10:13

2

Solved

In his paper Generics for the Masses Hinze reviews encoding of data type. Starting from Nat data Nat :: ⋆ where Zero :: Nat Succ :: Nat → Nat It can be viewed as an initial algebra NatF Nat -&g...
Landside asked 14/3, 2022 at 14:27

6

Solved

I just tried to implement Fermat's little theorem in JavaScript. I tried it both ways, a^(p-1) mod p = 1 and a^p mod p = a mod p. function fermat(a, p) { return (((a ^ (p - 1)) % p) === 1); } a...
Jujitsu asked 3/8, 2010 at 19:56

18

Solved

----------Updated ------------ codymanix and moonshadow have been a big help thus far. I was able to solve my problem using the equations and instead of using right shift I divided by 29. Because ...
Kanishakanji asked 3/9, 2009 at 20:51

3

Grouping operator ( ) in JavaScript The grouping operator ( ) controls the precedence of evaluation in expressions. Does the functionality ( ) in JavaScript itself differ from Haskell or any oth...
Noblenobleman asked 30/9, 2021 at 0:7

5

Solved

If F := GF(p^n) is the finite field with p^n elements, where p is a prime number and n a natural number, is there any efficient algorithm to work out the product of two elements in F? Here are my ...
Excitant asked 20/12, 2009 at 12:12

2

I am trying to write a program that simplifies mathematical expressions. I have already written a parser that converts a string to a binary tree. For example (1+2)*x will become * / \ + x / \ 1...
Affectional asked 19/2, 2021 at 16:2

1

Until today I had the assumption that fromInteger in the Num class was a ring homomorphism. I had assumed this because integer is is coterminal so every ring must have a unique homomorphism from in...
Gerthagerti asked 26/1, 2021 at 12:59

3

Solved

I want to find the solution of: -x^3+6*x^2+51*x+44=0 but with R. Is it possible? I found the package Ryacas, but nobody seems to be able to make it work. May sound trivial, but I'm not able ...
Epencephalon asked 16/9, 2015 at 3:21

6

Solved

For any whole number input W restricted by the range R = [x,y], the "overflow," for lack of a better term, of W over R is W % (y-x+1) + x. This causes it wrap back around if W exceeds y. As an exa...
Reavis asked 9/2, 2013 at 5:59

6

I've a client selling wine bottles. He uses boxes with space for 6 bottles, 12 bottles, 18 bottles and 21 bottles. But he only wants to accept orders which fit exactly into these boxes. There must ...
District asked 16/9, 2019 at 20:2

5

Solved

As part of a program that I'm writing, I need to compare two values in the form a + sqrt(b) where a and b are unsigned integers. As this is part of a tight loop, I'd like this comparison to run as ...
Prefatory asked 8/5, 2019 at 8:58

5

Solved

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<String, Integer> vars = new Has...
Upstroke asked 13/1, 2011 at 15:46

4

Solved

Is there any algorithm to calculate (1^x + 2^x + 3^x + ... + n^x) mod 1000000007? Note: a^b is the b-th power of a. The constraints are 1 <= n <= 10^16, 1 <= x <= 1000. So the value o...
Giddings asked 17/1, 2017 at 10:56

3

In Pygame, how can I calculate the coordinates for the three points of the head of an arrow, given a start point and an end point for the arrow, so that the arrowhead points in the same direction a...
Bloodhound asked 20/4, 2017 at 19:6

3

Solved

I'm trying to find how many 10 and 50 dollar bills go into $1760 if there are only 160 bills. I figured, with the help of a friend, that using a nested for-loop is the best way to go but I'm having...
Pilarpilaster asked 31/12, 2018 at 8:31

4

I read a brief article about Prolog and Logic Programming. I'm curious if Logic Programs can do algebra. Like would you be able to ask what the Variable of X is in the equation 5+X = 7 and get an a...
Sumikosumma asked 3/12, 2012 at 19:19

1

Solved

I am curious to why multiplying a sparse-matrix by a dense-matrix takes a different time than the reverse. Are the algorithms significantly different? Here's an example in matlab 2018a: a=sprand...
Yaekoyael asked 22/7, 2018 at 1:51

11

Solved

I am going to start learning Abstract Algebra- Groups, Rings,etc. I am interested to know any programming language, if at all which can help me learn/try the concepts I learn in theory. EDI...
Spurling asked 24/2, 2009 at 3:28

© 2022 - 2025 — McMap. All rights reserved.