C# – Discrete Mathematics

“How can you own numbers? Numbers belong to the world.” – Maestro Knuth


Recommended Books
 (click for Amazon link)

      

 

Introduction

Discrete Math is a branch of mathematics that is mainly concerned with the uses of sets and integers, both of which are ‘discrete’, separate objects from one another. The phrase was coined in the 1980s as a catch-all for math topics that were useful for computer science majors, and has evolved into a study on how to think about problem solving in the real world using mathematical (and therefore computational) models.

Discrete math topics often are more concerned with reasoning than numbers – many classes begin with logical statements, mathematical proofs and induction, the important ability to prove something true for infinite amounts of data using two finite steps. When designing programs that will be run on potentially millions of machines around the world, this will help you feel confident that the algorithms and logic you designed will work correctly, no matter the environment it is run in.

Discrete math certainly has its numerical topics as well. The study of summations and their closed algorithmic forms will help you with algorithmic optimization through use of big-O notation, and working with matrices and vectors will give you an introduction into the logic needed to work with large sets of ordered data in their programs.

When companies such as Google and Yahoo were first developing their internet algorithms, they turned to graph theory, another major component of discrete math. Graphs can be used to model relationships between objects and sets of objects. They are also used to model practically any algorithmic problem, and once you have defined the problem as a graph, you can solve it through graph operations like traversal or by checking for connectivity and circularity.

Because discrete math covers such a wide variety of mathematics, it has become the best way to group the most important topics in math needed for computer science. The more exposure a person has to these topics, the better they will be able to handle the challenges of software engineering.

Reference

 

Resources

Discrete Mathematics in the Real World (MathILy) (website)  [free]

Discrete Mathematics (TutorialsPoint) (website)  [free]

Discrete Mathematics (Udemy) (course)  [paid]

Discrete Mathematics for Computer Science (Berkeley) (course content)  [free]

What exactly is Discrete Mathematics? (Quora)  [free]

Spiral Workbook for Discrete Mathematics (PDF)  [free]

Discrete Mathematics Notes (Yale) (PDF)  [free]

CS 30: Discrete Mathematics in Computer Science (Dartmouth) (lectures)  [free]

 

IDE

I used Visual Studio Community 2017 to do coding and testing.

 

Code Examples

01 – Perform all Basic Arithmetic Operations
02 – Generate the Factorial of a Given Number
03 – Generate the Sum of N Numbers
04 – Check Whether the Entered Number is an Armstrong Number or Not
05 – Check Whether the Entered Number is a Perfect Number or Not
06 – Generate Fibonacci Series
07 – Return Factors of Entered Number
08 – Return the H.C.F. of a Given Number
09 – Check Whether the Entered Number is a Amicable Number or Not
10 – Add 2 Complex Numbers
11 – Return Greatest Common Divisor (GCD)
12 – Calculate the Series sin(x)=x-x^3/3!+x^5/!-x^7/7!+
13 – Trigonometry Angles in Degrees
14 – Trigonometry Angles in Radians
15 – Create Multiplication Table
16 – Standard Deviation of a Set of Given Numbers
17 – Mean of Given Set of Numbers
18 – Calculate Simple Interest
19 – Calculate Compound Interest
20 – Find the Value of Cos(x)
21 – Reverse a Number and Check if it is a Palindrome
22 – Calculate the Distance Traveled by Reading Speed and Time
23 – Check Whether Number is a Prime number, if so, Display Largest Factor
24 – Display a Pascal Triangle
25 – Sum of first 50 Natural Numbers using For Loop
26 – Multiply given Number by 4 using Bitwise Operators
27 – Sum of Two Binary Numbers
28 – Display Floyd’s Triangle with a Numeric Mode
29 – Multiplication of two Binary Numbers
30 – Perform Multiplication of Exponents of Same Base
31 – Check the Edge Values in Power Function
32 – Calculate Fractional Power
33 – Calculate the Power Exponent Value
34 – Calculate Period Duration
35 – Calculate Power of Three
36 – Find Whether the Number is Divisible by 2
37 – Show Bitwise Operations
38 – Find Power of 2 using Bitwise Operator
39 – Find Roots of a Quadratic Equation
40 – Display Absolute Value of a Number
41 – Add Two Dates
42 – Generate Register Number Automatically for Students using Static Constructor
43 – Return Lowest Common Multiple (LCM)
44 – Return all the Multiples of 17 which are Less than 100
45 – Return the Sum of all the Multiples of 3 and 5
46 – Return the Cube Root of a Given Number
47 – Return the Square Root of a Given Number
48 – Calculate Area and Volume of a Cone
49 – Calculate nPr
50 – Volume and Surface Area of a Sphere

51 – Calculate Perimeter of Circle and Rectangle
52 – Calculate the Value of nCr
53 – Return the Maximum Range of Values for Decimal, Float, and Double Datatype
54 – Return the Minimum Range of Values for Decimal, Float, and Double Datatype
55 – Calculate 25% Probability
56 – Calculate the Inner Angles of a Trapezoid
57 – Trigonometric Identities
58 – Implement Sin Method
59 – Implement Cos Method
60 – Calculate Root, Mean, Square
61 – Determine if Given Number is a Multiple of 3
62 – Return Prime Factors of Given Number
63 – Return Factorials of 1 through 10
64 – Using Math.Sign Method
65 – Returns Angle whose Tangent is the Given Number
66 – Return Area and Circumference of Circle

< back

 

tags: Discrete Mathematics, MrNetTek