discrete-mathematics

How Does Relational Theory Apply in Ways I can Care About while Learning it?

So I'm taking the Discrete Math course from MIT's OpenCourseWare and I'm wondering... I see the connection between relations and graphs but not enough to "own" it. I've implemented a simple state machine in SQL as well so I grok graphs pretty well, just not the more rigorous study of how relations and sets compeltely apply. Should I just...

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

Math skills are becoming more and more essential, I'm wonder where is a good place to brush up on some basics before moving on to some more CompSci specific stuff? A sight with lots of video's as well as practise exercises would be a double win but I cant seem to find one. ...

Is there a tool that supports discrete mathematics?

Discrete mathematics (also finite mathematics) deals with topics such as logic, set theory, information theory, partially ordered sets, proofs, relations, and a number of other topics. For other branches of mathematics, there are tools that support programming. For statistics, there is R and S that have many useful statistics functions ...

Constrained Sequence to Index Mapping

I'm puzzling over how to map a set of sequences to consecutive integers. All the sequences follow this rule: A_0 = 1 A_n >= 1 A_n <= max(A_0 .. A_n-1) + 1 I'm looking for a solution that will be able to, given such a sequence, compute a integer for doing a lookup into a table and given an index into the table, generate the sequence. ...

Recommendations for discrete math resources

Hi, I recently Graduated from uni in the UK but I only scraped through the Algorithmic and Mathsy units that I was made to do and am now finding that I'd actually like to know how to do some of the stuff that was taught. In particular I'm trying to follow the MIT lectures of the Algorithms lectures on Google Video. I'm finding it very ...

Every graph node is connected with every other node. There are N * (N - 1)/2 edges.

In a graph, every node is connected with every other node, with no redudant connections. That is, if A->B then B doesn't need to go to A. It is still one connection. I know that there are N * (N - 1)/2 Edges. In a loop, it would look like, for(int i = 0; i < n - 1; i++) for(int j = i + 1; j < n; j++) I can't remember the for...

Which algorithm for assigning shifts (discrete optimization problem)

I'm developing an application that optimally assigns shifts to nurses in a hospital. I believe this is a linear programming problem with discrete variables, and therefore probably NP-hard: For each day, each nurse (ca. 15-20) is assigned a shift There is a small number (ca. 6) of different shifts There is a considerable number of const...

Compute a derivative using discrete methods

I am looking for a method to compute a derivate using a discrete and fast method. Since now I do not know the type of equation I have, I am looking for discrete methods analog to the ones that we can find for the integral such as, the Euler method. Thanks a lot. ...

Algorithm for checking transitivity of relation?

I need to check if relation is transitive or not? Would you please suggest some algorithm to check the transitivity of relations? I am storing relation as a boolean matrix there is 1 if elements are related other wise 0 like in graphs. Thanks. ...

Is there an algorithm for calculating the multiplicative order of x modulo y (for y < 1000) that doesn't require a BigInteger type?

The algorithm I'm using at the moment runs into extremely high numbers very quickly. A step in the algorithm I'm to raises x to the result of the totient function applied to y. The result is that you can run into very large numbers. Eg. When calculating the multiplicative order of 10 modulo 53: 10^totient(53) == 10^52 == 1 * 10^52 ...

Is a given set of group elements a set of coset representatives?

I am afraid the question is a bit technical, but I hope someone might have stumbled into a similar subject, or give me a pointer of some kind. If G is a group (in the sense of algebraic structure), and if g1, ..., gn are elements of G, is there an algorithm (or a function in some dedicated program, like GAP) to determine whether there i...

Difference between Discrete Structures and Discrete Mathematics

I haven't yet found a good answer. Or any answer, for that matter. I've been asked to teach a discrete structures for CS course, but at the same time make sure it's not a discrete mathematics course -- that's offered by the Mathematics department. Many colleges offer a discrete structures course. There are also many DS textbooks. But wh...

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, and Computability in part because it contains examples and concepts that are conducive to implementation with a functional programming language. (I also think it's a good textbook.) I want an easy-to-underst...

Recommend book for discrete math

What book would you recommend for Discrete Math? Thanks. ...

Computing the second (mis-match) table in the Boyer-Moore String Search Algorithm

For the Boyer-Moore algorithm to be worst-case linear, the computation of the mis-match table must be O(m). However, a naive implementation would loop through all suffixs O(m) and all positions in that that suffix could go and check for equality... which is O(m3)! Below is the naive implementation of table building algorithm. So this qu...

How can I check parity without converting to binary?

How can I get the number of "1"s in the binary representation of a number without actually converting and counting ? e.g. def number_of_ones(n): # do something # I want to MAKE this FASTER (computationally less complex). c = 0 while n: c += n%2 n /= 2 return c >>> number_of_ones(5) 2 >>> ...

Can anybody explain the contrapositive

I'm trying to construct a contrapositive for the following statement: If A is 0 or B is 0, then A*B is 0. Here is my attempt: If A*B is not 0, then A is not 0 or B is not 0. The original statement is true, but the contrapositive is false since both A and B must be non-zero in order for A*B to be non-zero... am I doing something wrong? ...

How do I build this finite automaton?

I'm studying for a Discrete Mathematics test and I found this exercise which I can't figure out. "Build a basic finite automaton (DFA,NFA,NFA-lambda) for the language in the alphabet Sigma = {0,1,2} where the sum of the elements in the string is even AND this sum is more than 3" I have tried using Kleene's Theorem concatenating two lan...

Where are "Special Numbers" mentioned in Concrete Maths used?

I was glancing through the contents of Concrete Maths online. I had at least heard most of the functions and tricks mentioned but there is a whole section on Special Numbers. These numbers include Stirling Numbers, Eulerian Numbers, Harmonic Numbers so on. Now I have never encountered any of these weird numbers. How do they aid in com...

Evenly distributed random numbers relatively prime to 2

A specific example I need to generate a random number between 0 and 2, inclusive. (or choose randomly between -1, 0, and 1). The naive approach would be to do something like rand() mod 3 where rand() returns an integer. This approach will not generate statistically random numbers unless the upper bound of rand() is not relatively prim...