Discrete Mathematics Notes - 1
Discrete Mathematics Notes - 1
3 ElegantLATEX Templates 6
3.1 ElegantBook Updates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.2 Installation and Update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.3 About Pull Request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4 ElegantBook Settings 8
4.1 Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.2 Device Mode Option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.3 Color Themes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.4 Cover . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4.5 Chapter Title Display Styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.6 Introduction of Math Environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.7 List Environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.8 Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.9 Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.10 Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.11 Content Option and Depth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.12 Introduction Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Chapter 4 Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.13 Margin Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
6 FAQ 19
7 Version History 20
A Mathematical Tools 22
A.1 Summation Operator and Description Statistics . . . . . . . . . . . . . . . . . . . . . . . . . 22
Chapter 1 What is Discrete Mathematics?
N = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, . . .}
and
Z = {. . . , −3, −2, −1, 0, 1, 2, 3, . . .}.
Moreover, any collection of objects that can be associated with the sets above are considered discrete
objects. Hence, they can be studied in “Discrete Mathematics”. The kind of problems solved using discrete
mathematics include:
How many ways are there to choose a valid password on a computer system?
What is the probability of winning a lottery?
Is there a link between two computers in a network?
How can I identify spam e-mail messages?
How can I encrypt a message so that no unintended recipient can read it?
What is the shortest path between two cities using a transportation system?
How can a list of integers be sorted so that the integers are in increasing order?
How many steps are required to do such a sorting?
How can it be proved that a sorting algorithm correctly sorts a list?
How can a circuit that adds two integers be designed?
How many valid Internet addresses are there?
You will learn the discrete structures and techniques needed to solve problems such as these.
More generally, discrete mathematics is used whenever objects are counted, when relationships between
finite (or countable) sets are studied, and when processes involving a finite number of steps are analyzed. A key
reason for the growth in the importance of discrete mathematics is that information is stored and manipulated
by computing machines in a discrete fashion.
2. Discrete mathematics is the gateway to more advanced courses in all parts of the mathematical sciences.
Discrete mathematics provides the mathematical foundations for many computer science courses, includ-
ing data structures, algorithms, database theory, automata theory, formal languages, compiler theory,
computer security, and operating systems. Students find these courses much more difficult when they
have not had the appropriate mathematical foundations from discrete mathematics.
3. Discrete mathematics is part of many math courses. Math courses based on the material studied in discrete
mathematics include logic, set theory, number theory, linear algebra, abstract algebra, combinatorics,
graph theory, and probability theory (the discrete part of the subject).
4. Discrete mathematics contains the necessary mathematical background for solving problems in operations
research (including discrete optimization), chemistry, engineering, biology, and so on. In the text, we will
study applications to some of these areas.
5. Discrete mathematics teaches mathematical reasoning and problem solving.
6. Discrete mathematics is an excellent environment in which to learn how to read and write mathematical
proofs.
2
Chapter 2 Logic and Proofs
On Logic
The rules of logic specify the meaning of mathematical statements.
Logic is the basis of all mathematical reasoning, and of all automated reasoning. It has practical appli-
cations to the design of computing machines, to the specification of systems, to artificial intelligence, to
computer programming, to programming languages, and to other areas of computer science, as well as to
many other fields of study.
On Proof
To understand mathematics, we must understand what makes up a correct mathematical argument, that
is, a proof.
Once we prove a mathematical statement is true, we call it a theorem.
To learn a mathematical topic, a person needs to actively construct mathematical arguments on this topic,
and not just read exposition.
Knowing the proof of a theorem often makes it possible to modify the result to fit new situations.
Proofs are used to verify that computer programs produce the correct output for all possible input values,
to show that algorithms always produce the correct result, to establish the security of a system, and to
create artificial intelligence.
2.1.1 Propositions
The rules of logic give precise meaning to mathematical statements. These rules are used to distinguish
between valid and invalid mathematical arguments. We begin by considering the basic building blocks of logic,
which are propositions.
Definition 2.1
A proposition is a declarative sentence (that is, a sentence that declares a fact) that is either true or false,
but not both. ♣
1 + 1 = 2.
1 + 1 = 0.
Example 2.2 The following are non-examples of propositions.
Do you want to build a snowman?
Come on let us go and play.
x + 1 = 2.
x2 + y 2 = z 2 .
Note
We use letters to denote propositional variables (or sentential variables), that is, variables that represent
propositions, just as letters are used to denote numerical variables. The conventional letters used for
propositional variables are p, q, r, s, . . ..
The truth value of a proposition is true, denoted by T , if it is a true proposition, and the truth value of a
proposition is false, denoted by F , if it is a false proposition.
Propositions that cannot be expressed in terms of simpler propositions are called atomic propositions.
The area of logic that deals with propositions is called the propositional calculus or propositional logic.
It was first developed systematically by the Greek philosopher Aristotle more than 2300 years ago.
Exercise 2.1 Write down the negation of each of the following propositions.
1. Janice has more Facebook friends than Juan.
2. Steve has more than 100 GB free disk space on his laptop.
3. 7 · 11 · 13 = 999.
4. The mean in a normal distribution is zero.
Definition 2.3
A truth table for a compound proposition shows how the truth or falsity of a compound proposition
depends on the truth or falsity of the simple propositions from which it is constructed.
♣
Note
The truth table for a negation of a proposition p is provided in the table below.
p ¬p
T F
F T
Table 2.1: The truth table for ¬p.
4
2.1 Propositional Logic
The negation of a proposition can also be considered the result of the operation of the negation operator
on a proposition. The negation operator constructs a new proposition from a single existing proposition.
We will now introduce the logical operators that are used to form new propositions from two or more
existing propositions. These logical operators are also called connectives.
5
Chapter 3 ElegantLATEX Templates
ElegantLATEX Program developers are intended to provide you beautiful, elegant, user-friendly templates.
Currently, the ElegantLATEX is composed of ElegantNote, ElegantBook, ElegantPaper, designed for typesetting
notes, books, and working papers respectively. Latest releases are strongly recommended! This guide is aimed
at briefly introducing the 101 of this template. For any other question, suggestion or comment, feel free to
contact us on GitHub issues or email us at [email protected].
Contact Infos:
Homepage: https://elegantlatex.org/
GitHub: https://github.com/ElegantLaTeX/
CTAN: https://ctan.org/pkg/elegantbook
Wiki: https://github.com/ElegantLaTeX/ElegantBook/wiki
Download: release, latest version
Weibo: ElegantLATEX
Wechat: ElegantLATEX
QQ: 692108391
Email: [email protected]
7
Chapter 4 ElegantBook Settings
This template is based on the Standard LATEX book class, so the options of book class work as well (Note
that the option of papersize has no effect due to device option). The default encoding is UTF-8 while TEX Live
is recommended. The test environment is Win10 + TEX Live 2021, either pdfLATEX or XƎLATEX works fine.
XƎLATEX is preferred for Chinese articles.
4.1 Languages
We defined one option named lang which has two basic values, lang=en (default) , lang=cn. Different
values will alter the captions of figure/table, abstract name, refname, etc. You can use this option as
\documentclass[en]{elegantbook}
\documentclass[lang=en]{elegantbook}
Besides the two basic language translation, our user provide more options, here is a short brief introduction
to these translation. Since I am not familiar with these languages, I can’t guarantee that the translations are
correct, please comment on GitHub if you have some questions.
Italian translation lang=it, provided by VincentMVV , please refer to Italian translation;
French translation lang=fr, provided by abfek66 , please refer to Italian translation;
Dutch Translation lang=nl, provided by inktvis75 , please refer to Dutch Translation;
Hungarian translation lang=hu, provided by palkotamas, please refer to Hungarian translation;
Deutsch translation lang=de, provided by Lisa, please refer toDeutsch translation;
Spanish translation lang=es, provided by Gustavo A. Corradi, please refer to Spanish translation;
Mongolian translation lang=mn, provided by Altantsooj, please refer to Mongolian translation.
Remark Chinese Characters are acceptable ONLY in lang=cn.
\documentclass[green]{elegantbook} %or
\documentclass[color=green]{elegantbook}
third proposition
If you want to customize the colors, please select nocolor or use color=none and declare the main, second,
and third colors in the preamble section as follows:
\definecolor {structurecolor}{RGB}{60,113,183}
\definecolor {main}{RGB}{0,166,82}%
\definecolor {second}{RGB}{255,134,24}%
\definecolor {third}{RGB}{0,174,247}%
4.4 Cover
You can change the color of the horizontal bar of the cover by
9
4.5 Chapter Title Display Styles
\definecolor {customcolor}{RGB}{32,178,170}
\colorlet { coverlinecolor }{customcolor}
4.4.3 Logo
Aspect ratio of the logo is 1:1 in this guide, i.e. a square picture. To replace the logo, do remember to
choose the appropriate picture.
10
4.6 Introduction of Math Environments
Example Environments, including example, exercise, problem environment, auto numbering correspond-
ing to chapter.
Proof Environment, including proof, note environment containing introductory symbol (note environ-
ment) or ending symbol (proof environment).
Conclusion Environments, including conclusion, assumption, property, remark and solution4 envi-
ronments, all of which begin with boldfaced words, with format consistent with normal paragraphs.
The first parameter <theorem name> represents the name of the theorem, and the second parameter label
represents the label used in cross-reference with ref{thm:label}. Note that cross-references must be prefixed
with thm:.
From version 4.1, you can write your theorem environments as follows:
\begin{theorem}[theorem name]\label{thm:label text}
The content of theorem.
\end{theorem}
% or
\begin{theorem}
The content of theorem.
\end{theorem}
4
We also define an option result, which can hide the solution and proof environments. You can switch between result=answer and
result=noanswer.
11
4.7 List Environments
\end{example}
4.8 Fonts
Alert After v3.10, newtx is reset to cm, together with other two options, the math font option offers:
1. math=cm(default), use LATEX default math font (recommended).
2. math=newtx, use newtxmath math font (may bring about bugs).
3. math=mtpro2, use mtpro2 package to set math font.
If you use newtx fonts, type in:
\documentclass[math=newtx]{elegantbook}
When you are using newtx, please pay attention to the hyphens. For instance,
∫
f (x, y)dy.off (4.1)
Rq
The corresponding code is:
\begin{equation}
\int_{R^q} f(x,y) dy.\emph{of \kern0pt f}
\end{equation}
12
4.9 Bibliography
LaTeX Error:
Too many symbol fonts declared.
The reason is that the template redefines font for math so that no new math font is allowed to be added.
To use yhmath and/or esvect, please locate yhmath or esvect in elegantbook.cls, uncomment corresponding
related code.
%%% use yhmath pkg, uncomment following code
% \let\oldwidering\widering
% \let\widering\undefined
% \RequirePackage{yhmath}
% \let\widering\oldwidering
4.9 Bibliography
This template uses biblatex to generate the bibliography, the default citestyle and bibliography style are
both numeric. Let’s take a glance at the citation effect. [3] use data from a major peer-to-peer lending [2]
marketplace in China to study whether female and male investors evaluate loan performance differently [1].
If you want to use biblatex, you must create a file named reference .bib, add bib items (from Google
Scholar, Mendeley, EndNote, and etc.) to reference .bib file, then cite the bibkey in the tex file. The biber will
automatically generate the bibliography for the reference you cited.
To change the bibliography style, this version introduces citestyle and bibstyle , please refer to CTAN:biblatex
for more detail about these options. You can change your bibliography style as
\documentclass[citestyle=numeric-comp, bibstyle=authoryear]{elegantbook}
4.10 Preface
If you want to add a preface before the first chapter with the number of chapter unchanged, please add the
preface in the following way:
\chapter*{Introduction}
\markboth{Introduction}{Introduction}
The content of introduction.
13
4.12 Introduction Environment
Introduction
h Definition of Theorem h Property of Cauchy Series
h Ask for help h Angle of Corner
h Optimization Problem
You can change the title of this environment by modifying the optional argument of this environment:
\begin{introduction}[Brief Introduction]
...
\end{introduction}
The environment problemset is used at the end of each chapter to display corresponding exercises. Just
type in the following sentences:
\begin{problemset}
\item exercise 1
\item exercise 2
\item exercise 3
\end{problemset}
K Chapter 4 Exercise k
1. exercise 1
2. exercise 2
3. exercise 3
4. math equation test:
a2 + b2 = c2i (1, 2)[1, 23] (4.2)
Remark If you want to customize the title of problemset, please change the optional argument like in introduc-
tion environment. In this version the problemset environment automatically appears in the table of contents
but not in the header or footer(to be fixed).
Solution If you want to customize the title of problemset, please change the optional argument like in intro-
duction environment. In this version the problemset environment automatically appears in the table of contents
but not in the header or footer(to be fixed).
14
4.13 Margin Notes
% equation
\marginpar{
\begin{equation}
a^2 + b^2 = c^2
\end{equation}
}
For tables and figures, note that floating environment is not allowed. You have to use includegraphics or
table and use \captionof to name it. To get centralized figures or tables, use \centerline or center. To learn
more, please refer to Caption of Figure in Marginpar.
% graph with centerline command
\marginpar{
\centerline {
\includegraphics[width=0.2\textwidth]{logo.png}
}
\captionof{figure}{your figure caption}
}
15
Chapter 5 ElegantBook Writing Sample
Introduction
h Theorem Class Envrionments h List Environments
h Cross Reference h Logo and Base
h Math Environments h a 2 + b2 = c 2
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipi-
scing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate
a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada
fames ac turpis egestas. Mauris ut leo. Cras viverra metus rhoncus sem. Nulla et lectus vestibulum urna fringilla
ultrices. Phasellus eu tellus sit amet tortor gravida placerat. Integer sapien est, iaculis in, pretium quis, viverra
ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aenean faucibus. Morbi dolor nulla, malesuada eu,
pulvinar at, mollis ac, nulla. Curabitur auctor semper nulla. Donec varius orci eget risus. Duis nibh mi, congue
eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim rutrum.
5.1 Nulla malesuada porttitor diam. Donec felis erat, congue non, volutpat at, tincidunt tristique, libero.
Vivamus viverra fermentum felis. Donec nonummy pellentesque ante. Phasellus adipiscing semper elit. Proin
fermentum massa ac quam. Sed diam turpis, molestie vitae, placerat a, molestie nec, leo. Maecenas lacinia.
Nam ipsum ligula, eleifend at, accumsan nec, suscipit a, ipsum. Morbi blandit ligula feugiat magna. Nunc
eleifend consequat lorem. Sed lacinia nulla vitae enim. Pellentesque tincidunt purus vel magna. Integer non
enim. Praesent euismod nunc eu purus. Donec bibendum quam in tellus. Nullam cursus pulvinar lectus. Donec
et mi. Nam vulputate metus eu enim. Vestibulum pellentesque felis eu massa.
5.2 Second section
Proof Let z be some element of xH ∩ yH. Then z = xa for some a ∈ H, and z = yb for some b ∈ H.
If h is any element of H then ah ∈ H and a−1 h ∈ H, since H is a subgroup of G. But zh = x(ah) and
xh = z(a−1 h) for all h ∈ H. Therefore zH ⊂ xH and xH ⊂ zH, and thus xH = zH. Similarly yH = zH,
and thus xH = yH, as required.
Regression analysis is a powerful statistical method that allows you to examine the relationship between two
or more variables of interest. While there are many types of regression analysis, at their core they all examine
the influence of one or more independent variables on a dependent variable. The process of performing a
regression allows you to confidently determine which factors matter most, which factors can be ignored, and
how these factors influence each other.
Let’s continue using our application training example. In this case, we’d want to measure the historical
levels of satisfaction with the events from the past three years or so, as well as any information possible in
regards to the independent variables.
17
Chapter 5 Exercise
lacus libero, pretium at, lobortis vitae, ultricies et, tellus. Donec aliquet, tortor sed accumsan bibendum, erat
ligula aliquet magna, vitae ornare odio metus a mi. Morbi ac orci et nisl hendrerit mollis. Suspendisse ut massa.
Cras nec ante. Pellentesque a nulla. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
ridiculus mus. Aliquam tincidunt urna. Nulla ullamcorper vestibulum turpis. Pellentesque cursus luctus mauris.
Routing and resource discovery;
Language Models
Vector Space Models
Resilient and scalable computer networks;
Distributed storage and search.
K Chapter 5 Exercise k
1. Solve the equation 5(−3x − 2) − (x − 3) = −4(4x + 5) + 13.
2. Find the distance between the points (−4, −5) and (−1, −1).
3. Find the slope of the line 5x − 5y = 7.
18
Chapter 6 FAQ
We revised our templates now and then. This section shows the version story of ElegantBook. We have
nearly 100 submits and 17 releases on GitHub since uploaded.
[1] Charles T Carlstrom and Timothy S Fuerst. “Agency Costs, Net Worth, and Business Fluctuations: A
Computable General Equilibrium Analysis”. In: The American Economic Review (1997), pp. 893–910.
ISSN: 0002-8282.
[2] Qiang Li, Liwen Chen, and Yong Zeng. “The Mechanism and Effectiveness of Credit Scoring of P2P
Lending Platform: Evidence from Renrendai.com”. In: China Finance Review International 8.3 (2018),
pp. 256–274.
[3] Vincenzo Quadrini. “Financial Frictions in Macroeconomic Fluctuations”. In: FRB Richmond Economic
Quarterly 97.3 (2011), pp. 209–254.
Appendix A Mathematical Tools
This appendix covers some of the basic mathematics used in econometrics. We briefly discuss the proper-
ties of summation operators, study the properties of linear and some nonlinear equations, and review the ratios
and percentages. We also introduce some special functions that are common in econometrics applications,
including quadratic functions and natural logarithms. The first four sections require only basic algebraic tech-
niques. The fifth section briefly reviews differential Calculus Although Calculus is not necessary to understand
much of this book, it is used in some of the end-of-chapter appendices and in some of the more advanced topics
in part 3.
∑
n
xi ≡ x1 + x2 + · · · + xn (A.1)
i=1