# Math in Software Engineering / Computer Science degree

#### StrongPenguin

Joined Jun 9, 2018
287
So I had my first class today (studying SE), which was Computer Networks. At the end of the lecture, the teacher posed a few exercises, which looks nothing like what I had, when I did my marine engineering degree. I can see the logic in the exercises, but I was wondering which branch of math this is, so I can study it more closely, since I have a feeling I will be seeing a lot of it.

A few examples:

Suppose you have forgotten a password with 5 characters.
You only remember:
➢ the 5 characters are all distinct
➢ the 5 characters are B, D, M, P, Y
If you want to try all possible combinations, how many of them in total?

➢ a means letter, d means digit
➢ all characters are all distinct
➢ the 5 letters are B, D, M, P, Y
➢ the digit is either 0 or 1
How many combinations are there?

➢ a means letter, d means digit
➢ all characters are all distinct
➢ the 5 letters from B, D, M, P, Y, Z, W
➢ If B appears in the password, D will not be allowed to appear
➢ the digit is either 0 or 1
How many combinations are there?

#### jpanhalt

Joined Jan 18, 2008
11,088
I am not sure it is a specific field of math. The area would be called Combinations and Permutations.

Statistics is the closest area I can think of, but then I had very few math classes. None after high school.

Last edited:

#### WBahn

Joined Mar 31, 2012
26,398
I would say that it is "combinatorics" and is generally seen, to greater and lesser degrees, in courses such as Probability and Statistics (namely discrete probability), Discrete Math, and any course dealing with Set Theory.

#### StrongPenguin

Joined Jun 9, 2018
287
Ok, I will look into that. Thank you.

#### jpanhalt

Joined Jan 18, 2008
11,088
Ok, I will look into that. Thank you.
Why? Aren't you taking the course already? Work on your assignments rather than fritter it away looking at stuff on the Internet.

#### WBahn

Joined Mar 31, 2012
26,398
Work on your assignments rather than fritter it away looking at stuff on the Internet.
Uh, I think the fact that he's here (with the rest of us) pretty much rules out that approach.

#### Papabravo

Joined Feb 24, 2006
16,820
Uh, I think the fact that he's here (with the rest of us) pretty much rules out that approach.
@jpanhalt , a member on my ignore list, you'll find "sanctimony" in the dictionary under "S".

#### StrongPenguin

Joined Jun 9, 2018
287
The problem was me not having math for about 10 years, and we started with something that I never even seen before. If it was trigonometry or functions, I would feel more comfortable. The course is supposedly not math heavy, but I don't wanna fall behind, though.

#### jpanhalt

Joined Jan 18, 2008
11,088
@PB I am sure you are both "proud." Why do either of you think I care one twit?

Last edited:

#### WBahn

Joined Mar 31, 2012
26,398
I am sure you are both "proud." Why do either of you think I care one twit?
I don't know what PB's point was. I was merely making a purely light-hearted reference to how much time most of us that are anything resembling regulars here (most definitely myself included) fritter away on the internet (even if this is the only place we go on it). I apologize if it somehow offended either one of your sensibilities.

#### WBahn

Joined Mar 31, 2012
26,398
The problem was me not having math for about 10 years, and we started with something that I never even seen before. If it was trigonometry or functions, I would feel more comfortable. The course is supposedly not math heavy, but I don't wanna fall behind, though.
Pick up most introductory books to prob/stats that are targeting scientists and engineers and the first portion is usually discrete probability and early in that material quite a bit of time is spent on how to count the number of ways that things can happen given various constraints. That will probably be enough for your needs.

#### jpanhalt

Joined Jan 18, 2008
11,088
@WBahn
Please accept my apology. After reading PB's comment, I completely misinterpreted your comment. With fresh eyes, it is clear what you meant, and I am sorry to have included you in my reply.
John

#### WBahn

Joined Mar 31, 2012
26,398
@WBahn
Please accept my apology. After reading PB's comment, I completely misinterpreted your comment. With fresh eyes, it is clear what you meant, and I am sorry to have included you in my reply.
John

#### Hymie

Joined Mar 30, 2018
991
I suspect the purpose of the lecturer setting the examples is to get you thinking about the answers and how you worked out the answers – the next step would be to transfer that technique into computer programming.

Whilst it might not seem to have an obvious application in computing – knowing the possible total permutations (to which you are trying to find a solution), could give an indication of the computational time required to reach the solution(s).

#### bogosort

Joined Sep 24, 2011
678
The problem was me not having math for about 10 years, and we started with something that I never even seen before. If it was trigonometry or functions, I would feel more comfortable. The course is supposedly not math heavy, but I don't wanna fall behind, though.
The branch is called discrete mathematics, which includes logic, set theory, counting (combinatorics, discrete probability), graph theory. If such a class is part of your curriculum, take it as early as possible, as you will very likely need some familiarity with these topics in most CS/SE courses. If not, pick up a textbook (or PDF) and use it as a crash-course when needed. I can recommend Discrete Mathematics and its Applications by Rosen.

#### StrongPenguin

Joined Jun 9, 2018
287
We will have a course in Discrete Mathematics, but that is later on
I will study something now, just to be up to date with what the teacher is talking about. Thanks for the book rec.

#### StrongPenguin

Joined Jun 9, 2018
287
@Hymie Yes, most likely. We are a bit far from any programming, though, but this is probably a fine primer.

#### andrewmm

Joined Feb 25, 2011
1,757
@Hymie Yes, most likely. We are a bit far from any programming, though, but this is probably a fine primer.
programming is a lot about how to break up a problem into bits that can be dealt with,

I remember even now being asked to write a list of what I did in the morning to brush out teeth.
Nothing to do with programming ? , but getting one to think about flow , cause and effect. Key parts of programming.

keep with it, and good luck

#### WBahn

Joined Mar 31, 2012
26,398
While programming forces one to break up problems (often referred to as functional decomposition), most problems are amenable to it and math problems are not different.

The brushing teeth example is less about breaking problems down into smaller bits (decomposition) but more about algorithmic reasoning (expressing the solution to a problem in clear, unambiguous, executable steps free from contradiction or omission). While the two are different, they are certainly tightly coupled in practice.

#### BobaMosfet

Joined Jul 1, 2009
1,850
So I had my first class today (studying SE), which was Computer Networks. At the end of the lecture, the teacher posed a few exercises, which looks nothing like what I had, when I did my marine engineering degree. I can see the logic in the exercises, but I was wondering which branch of math this is, so I can study it more closely, since I have a feeling I will be seeing a lot of it.

A few examples:

Suppose you have forgotten a password with 5 characters.
You only remember:
➢ the 5 characters are all distinct
➢ the 5 characters are B, D, M, P, Y
If you want to try all possible combinations, how many of them in total?

➢ a means letter, d means digit
➢ all characters are all distinct
➢ the 5 letters are B, D, M, P, Y
➢ the digit is either 0 or 1
How many combinations are there?