Programming questions that are significantly affected or best defined by the underlying mathematics of the problem.

learn more… | top users | synonyms

58
votes
24answers
11k views

What does mathematics have to do with programming?

I just started a diploma in software development. Right now we're starting out with basic Java and such (so right from the bottom you might say) - which is fine, I have no programming experience apart ...
48
votes
12answers
9k views

Is there a canonical book on mathematics for programmers? [closed]

I'm a self-taught programmer. I am honestly not good in math. What advice you can give to improve my Mathematical skills so that I will not be so insecure around my fellow programmers? What are the ...
43
votes
23answers
29k views

Should certain math classes be required for a Computer Science degree? [closed]

For a Computer Science (CS) degree at many colleges and universities, certain math courses are required: Calculus, Linear Algebra, and Discrete Mathematics are few examples. However, since I've ...
37
votes
23answers
5k views

What programming jobs would be best for a mathematician? [closed]

I'm a math professor that is losing his job, and I'm trying to gain programming skills, since academic jobs are scarce these days. Are there particular types of programming jobs that I should try to ...
36
votes
14answers
17k views

Why does DirectX use a left-handed coordinate system?

I considered posting on Stack Overflow, but the question strikes me as being far too subjective since I can't think of a reasonable technical explanation for Microsoft's choice in this matter. ...
32
votes
15answers
3k views

Why use other number bases when programming

My coworkers and I have been bending our minds to figuring out why anyone would go out of their way to program numbers in a base other than base 10. I suggested that perhaps you could optimize longer ...
30
votes
17answers
3k views

Introducing Programming To a Mathematician [closed]

I currently am a programmer, I'm almost 16 years of age and have pretty much narrowed my careers down to something involving a Computer Science degree or Electrical Engineering degree (I know they are ...
26
votes
4answers
2k views

Can you use Pi as a crude random number generator?

I recently saw this question over at math.SE. It got me thinking. Could Pi be used as a crude random number generator? I mean the results are well known(how long has pi been computed to now?) but, Pi ...
24
votes
9answers
4k views

How to check if 4 points form a square?

Assume I have 4 points (they are 2-dimension), which are different from each other, and I want to know whether they form a square. How to do it? (let the process be as simple as possible.)
21
votes
11answers
3k views

Why do we still use floats? [duplicate]

I understand why floats served a purpose in the past. And I think I can see why they're useful in some simulation examples today. But I think those example are more exceptional than common. So I ...
20
votes
4answers
3k views

Is Haskell good at teaching fundamentals of mathematics?

I'm involved in teaching mathematics to classes with requirements such as AS and A level Mathematics specification. Class books normally provide examples of computer software applied to mathematics ...
18
votes
7answers
1k views

How can a large, Fortran-based number crunching codebase be modernized?

A friend in academia asked me for advice (I'm a C# business application developer). He has a legacy codebase which he wrote in Fortran in the medical imaging field. It does a huge amount of number ...
17
votes
4answers
4k views

Return random `list` item by its `weight`

I have, for example, this table +-----------------+ | fruit | weight | +-----------------+ | apple | 4 | | orange | 2 | | lemon | 1 | +-----------------+ I need to return random ...
16
votes
4answers
2k views

why are all the functional programming tutorials so mathy?

I've been trying to learn functional programming and most tutorials I have found use math as examples for the more complicated constructs (even the simple ones in some cases). Why is this? I would ...
15
votes
0answers
3k views

Do we have to learn Mathematics to be a good Programmer? [duplicate]

Do we have to learn Mathematics to be a good Programmer?
14
votes
4answers
864 views

Documenting mathematical logic in code

Sometimes, although not often, I have to include math logic in my code. The concepts used are mostly very simple, but the resulting code is not - a lot of variables with unclear purpose, and some ...
14
votes
9answers
3k views

Pure vs Applied Math For Programmers [closed]

Math has always been my thing in that I've always found the subject easy. Computer Science is my second love, though. Given the choice, I would prefer to major in Math. Since the only careers one ...
13
votes
5answers
2k views

Mathematics for Computer Science [closed]

I am going into university next year. I think maths would be one of the more important aspects of computer science. I recently saw the MIT Introduction to Algorithms video on YouTube and the maths ...
13
votes
2answers
469 views

Trying to understand the 2N lnN compares for quicksort

I was going through the analysis of quicksort in Sedgewick's Algorithms book. He creates the following recurrence relation for number of compares in quicksort while sorting an array of N distinct ...
12
votes
9answers
765 views

How is fundamental mathematics efficiently evaluated by programming languages?

As I get more and more involved with the theory behind programming, I find myself fascinated and dumbfounded by seemingly simple things.. I realize that my understanding of the majority of fundamental ...
12
votes
11answers
326 views

Should 'mathematical' functions follow mathematical notation?

I suppose this question is going to be immediately flagged as subjective, but which do you think is better: double volume(double pressure, double n_moles, double temperature) { return n_moles * ...
12
votes
5answers
2k views

Is functional programming strongly related to mathematics?

Is functional programming so related to mathematics because much of the functional programming is depicted with mathematical notions? Is it a MUST to have a strong base of maths to learn & ...
12
votes
4answers
731 views

Why is mod (%) a fundamental mathematical operator in many programming languages?

Is there a reason, historical or otherwise, why the modulus operator is part of a small set of standard operators in what seems like many languages? (+, -, *, / and %, for Java and C, with ** in Ruby ...
11
votes
4answers
2k views

Handling extremely large numbers in a language which can't?

I'm trying to think about how I would go about doing calculations on extremely large numbers (to infinitum - intergers no floats) if the language construct is incapable of handling numbers larger than ...
11
votes
5answers
631 views

Long term plan of attack to learn math?

I am a web-developer with a desire to expand my skill-set to mathematics relevant to programming. As 2nd career, I am stuck in college doing some of the requirements while working. I was hoping the ...
10
votes
6answers
2k views

Web Developer and Math [duplicate]

I have just learned HTML/CSS and I practice everything I read to make it more understandable to me and I really enjoy it. My goal is to be a Modern Web Developer both front and back-end, so I won't ...
10
votes
9answers
3k views

Will getting a degree in mathematics help in game development?

I'm two months away from getting my degree in systems engineering, which is to say, I learned how to code and code well using managed languages. The only reason I got into this career was because I ...
10
votes
5answers
697 views

Does any programming language use variables as they're in maths?

In maths, a variable means you can put any number there, and an equation will still be true: root(square(x)) = abs(x) In programming languages, this is not so: a var can change. In Python: y = ...
10
votes
5answers
743 views

Interview puzzle on traveling on a line segment

Here's an interesting question I came upon: Let's just say on a number line of length M, where 0 < M <= 1,000,000,000, you given N (1 < N <= 100,000) integer pairs of points. In each ...
9
votes
3answers
16k views

Good way to learn how to solve questions on InterviewStreet [duplicate]

Possible Duplicate: How do I adapt to pre-interview challenge questions? InterviewStreet is a new company that essentially acts as a filter for companies to find programmers that can code. ...
9
votes
1answer
2k views

Are there studies on what programming does to the brain? [closed]

Are there studies on what effects have programming languages on the brain or for that matter any other artificial languages in general, like mathematics ? Speaking from my personal experience I feel ...
9
votes
1answer
5k views

Math questions at a programmer interview? [closed]

So I went to an interview at Samsung here in Dallas, Texas. The way the recruiter described the job, he didn't make it sound like it was too math-oriented. The job basically involved graphics ...
8
votes
10answers
5k views

How do I transition from physics and math to programming? [closed]

I'm a physics PhD with little actual programming experience. I've always liked programming and played around with BASIC, Pascal as a teen, but the extent of my experience writing complex programs ...
8
votes
7answers
1k views

What would be an appropriate algorithm to factorise numbers in the range of a few billion?

I'm learning Python at the moment and to give me reasons to apply what i'm learning I'm having a crack at some of the problems on Project Euler I'm currently on number 3, which is to determine the ...
8
votes
1answer
347 views

Why is a Bayes classifier used for spam filtering?

I've been reading about Bayesian spam filtering and I think I understand the theory, but I just don't see why this approach is needed in order to calculate the likelihood of a message being spam, ...
8
votes
3answers
697 views

Math underpinnings of software testing?

In my software engineering course, we recently (briefly) covered testing. Over the course of the discussion some topics came up that made me wonder about the math underlying software testing (such as ...
8
votes
6answers
1k views

Improving programming and math skills at home [closed]

Apologies if this sounds like a blog. I'm currently completing tertiary eduction in order to be accepted into a CS course at university, and I would like to know what options are available to me to ...
7
votes
7answers
740 views

What mathematics should I review & master before enrolling in CS program (early 40s student, 20 years dev exp, no degree)

I am in my early 40s and plan to enroll in university this fall to pursue a long-postponed CS degree. I have been working as a developer for almost 20 years, but have found further advancement at ...
7
votes
8answers
3k views

How can calculus and linear algebra be useful to a system programmer?

I found a website saying that calculus and linear algebra are necessary for System Programming. System Programming, as far as I know, is about osdev, drivers, utilities and so on. I just can't figure ...
7
votes
3answers
471 views

how to programtically build a grid of interlocking but random sized squares

I want to create a two dimensional layout of rectangular shapes, a grid made up of random sized cubes. The cubed should fit together and have equal padding or margin (space between). Kind of like a ...
7
votes
5answers
5k views

What skills are needed for machine learning jobs?

I posted this question on Quora, but didn't get enough responses. reposting it here. I am a learner sitting at home and learning linear algebra, very interested on working in Machine Learning ...
7
votes
5answers
5k views

Recomendation for Math books related to computer science [duplicate]

Possible Duplicate: Is there a canonical book on mathematics for programmers? I need your recommendation for math books related to computer science in these areas: Boolean Algebra ...
7
votes
4answers
317 views

Fastest way to check if two square 2D arrays are rotationally and reflectively distinct

The best idea I have so far is to rotate first array by {0, 90, 180, 270} degrees and reflect it horizontally or/and vertically. We basically get 16 variations [1] of first array and compare them with ...
7
votes
1answer
196 views

Can relational algebra/calculus proofs be used to test/verify SQL?

Is it feasible or even possible to use relational algebra and/or relational calculus in the form of proofs to test/verify the correctness of SQL statements, functions, and stored procedures? It seems ...
7
votes
1answer
887 views

Discrete Mathematics Refreshers Course?

I graduated 8 years ago and did a discrete mathematics course in my 2nd year, but I've been told that I'll likely be asked discrete maths questions in an upcoming interview. Is there a simple ...
6
votes
3answers
828 views

Japanese Multiplication simulation - is a program actually capable of improving calculation speed?

On SuperUser, I asked a (possibly silly) question about processors using mathematical shortcuts and would like to have a look at the possibility at the software application of that concept. I'd like ...
6
votes
8answers
3k views

I love programming but never get projects started

I read this question and the most voted answer and said to myself "Those things are what I want to do! But why the heck I'm not doing it?" The problem here is that I can't get anything started. I ...
6
votes
8answers
3k views

What specific branches of Mathematics are useful for a programmer to learn?

I have less than 6 months to learn mathematics for my Master course in CS. (With no prior formal education in any computer/mathematics related area.) So I need to prepare my self to be tested on math ...
6
votes
7answers
2k views

Languages / methods to learn for scientific computing? [closed]

I'm a second-semester Junior working towards a Computer Science degree with a Scientific Computing concentration and a Mathematics degree with a concentration on Applied Discrete Mathematics. So, ...
6
votes
6answers
333 views

Formatting 'Complex' Math

Note: by 'complex' math I mean an equation with many steps involved and a wide mix of operators. A programmer should know the order that operators are evaluated in an equation. However it can be a ...