Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 ALGORITHM


  Eleven Equations True Computer Science Geeks Should (at Least Pretend to) Know

This idea is a complete rip off an article that appeared in Wired a little while ago and it got me thinking what would my list for Computer Science look like?  Plus I thought it might be a fun post and unlike the Wired list this one goes to eleven.  So here they are in no particular order:Binomial CoefficientThe Binomial Coefficient equation generates Pascal’s Triangle and gives you the coefficients for the Binomial Theorem these ideas are often attributed to Pascal but in fact they have been known in part for over a millennia.As I mentioned that this list is no particular ord...

2,714 0       ALGORITHMS COMPUTER SCIENCE EULER FORMULA FERMAT


  Surprising applications of math

The comments in the previous post touched on surprising applications of math, so I thought I’d expand this theme into it’s own post. Below I’ll give a couple general examples of surprising applications and then I’ll give a couple more personal applications I found surprising.Number theory has traditionally been the purest of pure mathematics. People study number theory for the joy of doing so, not to make money. At least that was largely true until the advent of public key cryptography. The difficulty of solving certain number theory problems now ensu...

2,072 0       MATH ALGORITHMS NUMBER THEORY DIFFERENTIAL EUQATION


  Translating math into code with examples in Java, Racket, Haskell and Python

Discrete mathematical structures form the foundation of computer science.These structures are so universal that most research papers in the theory of computation, programming languages and formal methods present concepts in terms of discrete mathematics rather than code.The underlying assumption is that the reader will know how to translate these structures into a faithful implementation as a working program.A lack of material explaining this translation frustrates outsiders.What deepens that frustration is that each language paradigm encodes discrete structures in a distinct way.Many of the e...

3,056 0       MATH ALGORITHMS FORMULA PROGRAM PYTHON


  Gcd Algorithm with JavaScript

How to find the greatest common divisor betweentwo integers? We may encounter this problem frequently in interviews or otheroccasions.Anefficient metho to find gcd is the Euclideanalgorithm, whichuses the divisionalgorithm incombination with the observation that the gcd of two numbers also divides theirdifference: divide 48 by 18 to get a quotient of 2 and a remainder of 12. Thendivide 18 by 12 to get a quotient of 1 and a remainder of 6. Then divide 12 by6 to get a remainder of 0, which means that 6 is the gcd. Formally, it could bewritten asgcd(a,0)= agcd(a,b)= gcd(b...

10,837 2       JAVASCRIPT ALGORITHM GCD IMPLEMENTATION


  Permutation algorithm with JavaScript

In secondary school, we have learned permutation. Basically, for n numbers, the number of permutations for these n numbers can be calculated to n! which is called 'n factorial'. But to display all the permutations on the screen, we need to use a recursive function. The problem is how to write this function. Next I write a program to display the permutations for n numbers with JavaScript. First, we need to understand that from these n numbers, we can first take any one number from it, and the (n-1) numbers remaining has the similar property as the n numbers, we need to find the permutation...

34,859 0       JAVASCRIPT ALGORITHM PERMUTATION IMPLEME


  How Duff’s Device Works

I like C, but I have to admit that, sometimes, “The Old Man of Programming” can be a bit of a killjoy. This is one of the most exciting eras in computer history, but lately, C’s acting like he doesn’t evenwant to have a good time. While the cool kids like Ruby and Haskell are living it up, C’s over in the corner obsessing over bits and bytes and memory alignment and pointers and the stack and machine architecture and unreachable allocations and multiple indirections…and it’s…kind of a buzzkill. You want to tell him, “Dude! Lighten ...

2,371 1       DUFF DEVICE ALGORITHM SWITCH CASE