math

What is a good textbook for Parallel Computing?

I am looking for a good textbook on Parallel Computing. Does anyone know any good textbooks on this subject. I would, also, prefer if this textbook covered parallel numeric techniques when solving partial differential equations. ...

Which are the most important Math skills in order to better understand cryptography?

I need to have a better understanding of cryptography, specially the mathematics behind some of the core concepts. However, my High School Maths knowledge has gone a bit blunt, and so I was wondering which topics I should revisit for this purpose? ...

Calculating rotation along a path.

Hello, I am trying to animate an object, let's say its a car. I want it go from point x,y,z to point x,y,z. It moves to those points, but it appears to be drifting rather than pointing in the direction of motion. So my question is: how can I solve this issue in my updateframe() event? Could you point me in the direction of some good r...

Finding the minimal coverage of an interval with subintervals

Suppose I have an interval (a,b), and a number of subintervals {(ai,bi)}i whose union is all of (a,b). Is there an efficient way to choose a minimal-cardinality subset of these subintervals which still covers (a,b)? ...

Does anyone have any experience using math.net

I have a project on my plate that will involve a lot of linear algebra; mostly matrix and vector algebra. I've been looking for a library to help me out, and I came across math.net http://mathnet.opensourcedotnet.info/ Math.net I am doing this project in .net 3.5 and will be using C# Does anyone have any experience with this librar...

Math factors game - who can write the most elegant solution?

Here's a fun exercise. http://www.hughchou.org/hugh/grid_game.cgi?CLEAR Who can write the most elegant yet performant code to win this game? My solution is in C/C++. #include<vector> #include<iostream> #include<fstream> #define N 64 std::vector<int> numbers(N+1); void init() { for(int i = 0; i < N+1; ++i) numbers[i] = 1; ...

Fastest way to determine if an integer's square root is an integer

I'm looking for the fastest way to determine if a long value is a perfect square (i.e. its square root is another integer). I've done it the easy way, by using the built-in Math.sqrt() function, but I'm wondering if there is a way to do it faster by restricting yourself to integer-only domain. Maintaining a lookup table is impratical (...

Shortest command to calculate the sum of a column of output on Unix?

I'm sure there is a quick and easy way to calculate the sum of a column of values on Unix systems (using something like awk or xargs perhaps), but writing a shell script to parse the rows line by line is the only thing that comes to mind at the moment. For example, what's the simplest way to modify the command below to compute and displ...

How can I best fill the gaps of my mathematics knowledge?

Every so often I get the impression that my knowledge of mathematics (as it pertains to the field of software development) has some gaps. I'm an educated person. I have a college degree. I've always enjoyed learning, which is why I would like to try to fill in these gaps. My job is in the financial industry, and I feel like many of the ...

How can I implement a RESTful webservice using C++?

Hi, I have to develop a computing intensive Web Service (say we are making really big Matrix computations) so I've think that the way to go is coding it in C++. I can't do a wrapper using SWIG or JNI in Java to benefit from the WS existing libraries because the computations are state dependant and involve big matrices. Passing those val...

C#: How do I do simple math, with rounding, on integers?

i want the result of an equation rounded to the nearest integer. e.g. 137 * (3/4) = 103 Consider the following incorrect code. int width1 = 4; int height1 = 3; int width2 = 137; int height2 = width2 * (height1 / width1); What is the proper way to perform "integer" math in C#? Do i really have to do: int height2 = (int)Math.Rou...

Sort numbers by sum algorithm

Hello all, I have a language-agnostic question about an algorithm. This comes from a (probably simple) programming challenge I read. The problem is, I'm too stupid to figure it out, and curious enough that it is bugging me. The goal is to sort a list of integers to ascending order by swapping the positions of numbers in the list. Each ...

Calculate exact result of complex throw of two D30

Okay, this bugged me for several years, now. If you sucked in statistics and higher math at school, turn away, now. Too late. Okay. Take a deep breath. Here are the rules. Take two thirty sided dice (yes, they do exist) and roll them simultaneously. Add the two numbers If both dice show <= 5 or >= 26, throw again and add the result to...

What is JavaScript's Max Int? What's the highest Integer value a Number can go to without losing precision?

Is this defined by the language? Is there a defined maximum? Is it different in different browsers? ...

Mathematics for AI/Machine learning ?

I intend to build a simple recommendation systems for fun. I read a little on the net and figured being good at math would enable on to build a good recommendation system. My math skills are not good. I am willing to put considerable efforts and time in learning maths. Can you please tell me what mathematics topics should I cover? Al...

C# - Why Math.Atan(Math.Tan(x)) != x ??

Excuse me for such a newbie question... If tan(x) = y and atan(y) = x why Math.Atan(Math.Tan(x)) != x?? I´m trying to calculate x in something like tan(2/x +3) = 5 so atan(tan(2/x + 3) = atan(5) and so on... but I´ve tried this: double d = Math.Atan(Math.Tan(10)); and d != 10... why? Thanks for your time! ...

What is the difference between equality and equivalence?

I've read a few instances in reading mathematics and computer science that use the equivalence symbol ≡, (basically an '=' with three lines) and it always makes sense to me to read this as if it were equality. What is the difference between these two concepts? ...

Simple way to interpolate between points in 3D space to form a smooth surface

I'm trying to come up with a simple and efficient way to create a smooth surface which intersects a number of given "sample" points. For any X,Y point on the surface, I identify up to 4 sample points in each of the 4 directions (the next higher and lower points on the X, and then the Y axes). Given this point, I want a way to compute a...

Standard C or Python libraries to compute standard deviation of normal distribution.

Say we have normal distribution n(x): mean=0 and \int_{-a}^{a} n(x) = P. What is the easiest way to compute standard deviation of such distribution? May be there are standard libraries for python or C, that are suitable for that task? ...

Should Quaternion based 3D Cameras accumulate Quaternions or Euler angles?

So I have written a Quaternion based 3D Camera oriented toward new programmers so it is ultra easy for them to integrate and begin using. While I was developing it, at first I would take user input as Euler angles, then generate a Quaternion based off of the input for that frame. I would then take the Camera's Quaternion and multiply it...