I started computer science in university. And we started learning about Discrete and it's mathematics which is completely based on logic, which I understand. however, how is predicates, sets, proofs are related to computers ? I want to know the reason for learning these stuff?
Very roughly speaking, Discrete Mathematics is the body of material that a computer scientist needs to know. You can look at it as that part of mathematics which doesn't involve limits, continuity, differentiation, or integration. In set notation, we have Discrete = Mathematics \ Calculus.
The usual topics in a Discrete course and their applications to CS are
- Propositional and predicate logic: used to establish the correctness of a program.
- Proofs: used throughout CS, for things like establishing the closure properties of, say, regular languages.
- Functions: obvious uses, since functions are ubiquitous in CS.
- Sets: you can't do much in the theory of databases without them
- Relations: again, fundamental for databases and also the basis for algorithms such as topological sorting
- Recurrences: lists and trees can be viewed as recursively defined. Also, you can't do much to establish the time or space complexity of algorithms without being conversant with recurrence relations
- Graphs and trees: when establishing the properties of networks
- Counting: again, fundamental for the design and analysis of algorithms
- Probability: for example, finding the average time complexity of an algorithm
Obviously, I've left out many more uses, but you get the idea. One could make the point that essentially all of CS beyond Programming I uses the concepts of Discrete in one way or another.