I have just satarted a degree in Computer science, and i was wondering if you can explain set theory to me. I will really appreciate it.

Recommended Answers

All 5 Replies

Well I'm confused exactly what with set theory you need help with. It's a very broad topic. Is this for a discrete math course?

Basically, a set consists of elements that can represent anything. You could have the set of letters in the alphabet, a set of 10 random numbers, etc. Sets are the foundation of probability.

For example, a classic question is, what is the probability of rolling a 2 on a fair die? The sample set is the set of all numbers that possibly could be rolled ... S = {1, 2, 3, 4, 5, 6}. The number 2 only appears once in the sample set, meaning that the probability of rolling a 2 is 1 out of 6 (1/6th). Now what is the probability of rolling a number greater than 4 on a fair die? Out of the sample set, this can be either a 5 or a 6. Therefore, the answer is 2 out of 6 (1/3rd).

if the set of tv stations you receive is {2,4,5,7,9,13}, what's the probability that ALL of those stations are showing a commercial at any given time?

(hint: 9 is a pbs station, so they're doing a pledge break)

Zero, because channel 9 never shows commercials, so it's impossible for all stations to be showing a commercial at the same time.

What is application of set in computer science field? or Set are where used in computers?

The most intuitively apparent place set theory is exposed though is in Databases (pretty much all of Database theory is set theory).Digital logic is another more specific subject where you will notice set theory the most.

But if you examine things a bit more closely you can see set theory in other aspects of computer science (as well as in the real world). In general programming, it can be argued that set theory is applied anytime you perform an if-then statement, or similar inclusion/exclusion operator. For example, "If 9 is in {2,4,5,7,9,13} then do this".

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.