Questions tagged [algebra]

Algebra is the branch of mathematics concerning the study of the rules of operations and relations, and the constructions and concepts arising from them. Questions about algebra that are not related to programming are off-topic at Stack Overflow.

Together with geometry, analysis, topology, combinatorics, and number theory, algebra is one of the main branches of pure mathematics.

Elementary algebra, often part of the curriculum in secondary education, introduces the concept of variables representing numbers. Statements based on these variables are manipulated using the rules of operations that apply to numbers, such as addition. This can be done for a variety of reasons, including equation solving. Algebra is much broader than elementary algebra and studies what happens when different rules of operations are used and when operations are devised for things other than numbers. Addition and multiplication can be generalized and their precise definitions lead to structures such as groups, rings and fields, studied in the area of mathematics called abstract algebra.

873 questions
5
votes
4 answers

Method to minimize boolean function in SOP-form

I'm dealing with boolean functions of which I can only (but safely) assume that they come in as a SOP and contain no negations (e.g. (A && B && C) || (A && B && D)). The number of disjunctions is usually > 5, the number of conjunctions within…
user2722968
  • 13,636
  • 2
  • 46
  • 67
5
votes
3 answers

Python Lambda Identity Matrix

I just tried to learn both list comprehensions and Lambda functions. I think I understand the concept but I have been given a task to create a program that when fed in a positive integer creates the identity matrix. Basically if I fed in 2 it would…
NoviceProgrammer
  • 257
  • 1
  • 8
  • 15
5
votes
1 answer

Can fixed-point functions be used on polynomials?

I was thinking of a way to represent algebraic numbers in Haskell as a stream of approximations. You could probably do this by some root finding algorithm. But that's no fun. So you could add x to the polynomial, reducing the problem to finding it's…
5
votes
1 answer

Generated methods for polynomial evaluation

I'm trying to come up with an elegant way to handle some generated polynomials. Here's the situation we'll focus on (exclusively) for this question: order is a parameter in generating an nth order polynomial, where n:=order + 1. i is an integer…
Sam Harwell
  • 97,721
  • 20
  • 209
  • 280
5
votes
1 answer

Is there C++ class that implements operations with permutations?

Is there C++ template class that implements operations with permutations and permutation group? Such class has to implement finding product and inverse, multiplication, etc.
Alexey Malistov
  • 26,407
  • 13
  • 68
  • 88
5
votes
11 answers

Where is a good place to brush up on some math?

Math skills are becoming more and more essential, and I wonder where is a good place to brush up on some basics before moving on to some more CompSci specific stuff? A site with lots of video's as well as practice exercises would be a double win but…
metacontent
  • 1,326
  • 1
  • 13
  • 18
5
votes
2 answers

Function to translate end coordinates of a line

I have two points at the end of a line. I need to get the end coordinates of a translation of this line. The translation will be a parallel line that is a distance d from the original line. here is an image of what i need: So I need a function…
braden.groom
  • 305
  • 2
  • 5
  • 16
4
votes
2 answers

Simplifying expression trees

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 2 The idea I had of simplifying such…
Freud
  • 51
  • 2
4
votes
1 answer

How can I perform algebra such as apple + apple = 2 apple?

Is its possible to define an algebra for string objects? For example: apple + apple = 2 apple apple + orange = orange + apple apple + 3.5 apple = 4.5 apple Are there built-in functions that could do that? Is the creation of a class structure…
Gideon
  • 43
  • 2
4
votes
2 answers

How do you leave roots in surd form in c#?

Example a: √12 =2√3 Example b: √16 = 4 I am trying to get both. Whilst I can of course use Math.Sqrt(4) to achieve outcome b, I've no idea how to achieve a, or further how to get both to work simultaneously which is the goal. How do I achieve this…
kizzer
  • 150
  • 7
4
votes
2 answers

Performing algebra with newtypes based on integers Haskell

I'm having some trouble with performing simple addition, subtraction -- any kind of algebra really with Haskells newtype. My definition is (show included so I can print them to console): newtype Money = Money Integer deriving Show What I'm trying…
Mats
  • 165
  • 1
  • 3
  • 14
4
votes
1 answer

How to find linearly independent vectors belonging to the null space of a non-square matrix? (Python)

I have a non-square matrix, and a method to determine the null space of the matrix (found from this thread: How to find the Null Space of a matrix in Python using numpy? ), but I have a few problems with taking this solution. For one, I'm not sure…
4
votes
2 answers

Solving a complex algebraic formula with java

I am trying to solve for y in the following equation using Java: For the sake of visibility I divided the numerator and denominator into separate variables. I need to compute for x = -3 through x = 4 moving in increments of 0.5. for(double x =…
davidxd33
  • 1,186
  • 4
  • 22
  • 38
4
votes
2 answers

Finding the roots of a polynomial

Given a polynomial of degree n, how can I reliably find all values of x where y = 0. I'm currently using the Math.Polynomial library, which doesn't seem to have this function built in. However, I could be missing something here, it seems like this…
user1890615
4
votes
1 answer

Multiply Tensors with different ranks

I would like to multiply two tensors with different ranks, e.g. tensor A -> (i x j x k x l) tensor B -> (l x m) to get another tensor with this dimensions. tensor C -> (i x j x k x m) = (i x j x k x l)*(l x m) In tensorflow I have to reshape all…
RobinHood
  • 377
  • 4
  • 20