Top "Discrete-mathematics" questions

NOTE: Only questions about software development related to discrete mathematics are on topic.

How do you calculate log base 2 in Java for integers?

I use the following function to calculate log base 2 for integers: public static int log2(int n){ if(n <= 0) …

java performance discrete-mathematics logarithm
Find non-common elements in lists

I'm trying to write a piece of code that can automatically factor an expression. For example, if I have two …

python algorithm list set discrete-mathematics
Could anyone explain Big O versus Big Omega vs Big Theta?

Possible Duplicate: Big Theta Notation - what exactly does big Theta represent? I understand it in theory, I guess, but …

big-o discrete-mathematics
Haskell or Standard ML for beginners?

I'm going to be teaching a lower-division course in discrete structures. I have selected the text book Discrete Structures, Logic, …

haskell functional-programming sml discrete-mathematics
Height of a tree with only one node

According to Wikipedia, The height of a tree is the length of the path from the root to the deepest …

tree height binary-tree discrete-mathematics
What does this definition of contiguous subsequences mean?

I don't understand the following definition of a contiguous subsequence: A contiguous subsequence of a list S is a subsequence …

algorithm discrete-mathematics
How to prove max number of connection between n nodes is n*(n-1)/2

Given n nodes, if every node is connected to every other node (except itself) the number of connections will be …

algorithm graph graph-algorithm discrete-mathematics
Why is squaring a number faster than multiplying two random numbers?

Multiplying two binary numbers takes n^2 time, yet squaring a number can be done more efficiently somehow. (with n being …

algorithm math bit-manipulation discrete-mathematics
Compute a derivative using discrete methods

I am looking for a method to compute a derivative using a discrete and fast method. Since now I do …

discrete-mathematics derivative
How to find the local minima of a smooth multidimensional array in NumPy efficiently?

Say I have an array in NumPy containing evaluations of a continuous differentiable function, and I want to find the …

python numpy discrete-mathematics mathematical-optimization