0% found this document useful (0 votes)
60 views24 pages

Discrete Mathematics Notes - 1

The document consists of lecture notes on Discrete Mathematics, covering its definition, importance, and applications in various fields such as computer science and operations research. It includes sections on logic and proofs, propositional logic, and provides an overview of mathematical reasoning and problem-solving techniques. The notes aim to develop mathematical maturity and foundational skills necessary for advanced studies in mathematics and related disciplines.

Uploaded by

rule8.exe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views24 pages

Discrete Mathematics Notes - 1

The document consists of lecture notes on Discrete Mathematics, covering its definition, importance, and applications in various fields such as computer science and operations research. It includes sections on logic and proofs, propositional logic, and provides an overview of mathematical reasoning and problem-solving techniques. The notes aim to develop mathematical maturity and foundational skills necessary for advanced studies in mathematics and related disciplines.

Uploaded by

rule8.exe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

Lecture Notes on Discrete Mathematics

(based from Discrete Mathematics and its


Applications by Kenneth H. Rosen)
Author: John Rafael Macalisang Antalan
Institute: Department of Mathematics and Physics, College of Science
Central Luzon State University
Date: February 3, 2025
Version: 1
Contents

1 What is Discrete Mathematics? 1


1.1 Discrete Mathematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Why Study Discrete Mathematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

2 Logic and Proofs 3


2.1 Propositional Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

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

5 ElegantBook Writing Sample 16


5.1 Writing Sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.2 Second section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Chapter 5 Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

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?

Objectives of the Chapter

The objectives of this chapter are for us to:


1. learn what discrete mathematics is.
2. understand why we need to study discrete mathematics.

1.1 Discrete Mathematics


Discrete mathematics is the part of mathematics that is devoted to the study of discrete objects. The word
“discrete” means consisting of distinct or unconnected elements. An example of discrete objects are the sets

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.

1.2 Why Study Discrete Mathematics


1. Through this course you can develop your mathematical maturity: that is, your ability to understand and
create mathematical arguments. You will not get very far in your studies in the mathematical sciences
without these skills.
1.2 Why Study Discrete Mathematics

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.

Objectives of the Chapter

The objectives of this chapter are for us to:


1. explain what makes up a correct mathematical argument and be familiar with tools to construct these
arguments.
2. develop an arsenal of different proof methods that will enable us to prove many different types of results.
3. use several strategies for constructing proofs.
4. learn what is a conjecture and explain the process of developing mathematics by studying conjectures.

2.1 Propositional Logic

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. ♣

Example 2.1 The following are examples of propositions.


Two of the programs being offered at Central Luzon State University are the Bachelor of Science in
Mathematics and the Bachelor of Science in Statistics.
Central Luzon State University is located in Cordillera Administrative Region.
2.1 Propositional Logic

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.

2.1.2 Producing New Propositions from Current Propositions


In his 1854 book The Laws of Thought, the English mathematician George Boole discussed a method on
producing new propositions from those that we already have. New propositions, called compound propositions,
are formed from existing propositions using logical operators.
Definition 2.2
Let p be a proposition. The negation of p, denoted by ¬p (also denoted by p̄), is the statement “It is
not the case that p.” The proposition ¬p is read“not p.” The truth value of the negation of p, ¬p, is the
opposite of the truth value of p.

 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]

3.1 ElegantBook Updates


Version 4.1 is the first version of 3.x, we add support for biblatex, theorem, and multilingual translation.
What’s new in this version:
1. ! Big Change: Change the bibliography method from BIBTEX to biblatex(with backend biber);
2. ! Big Change: Add support for the default theorem writing method (with optional name and label);
3. Add left and right space;
4. Support hyperlink from the text of TOC;
5. Remove the pdfLATEX compatiblity check for Chinese.
6. Add multilingual support, for french lang=fr, dutch lang=nl, Hungarian lang=hu, Spanish lang=es,
Mongolian lang=mn etc.

3.2 Installation and Update


Both portable version and installation package are available, online usage is optional as well.

3.2.1 To Use Templates Online


Visit Overleaf to use our template online anywhere and anytime without local installation. To find our
template, search elegantlatex in the templates or simply visit search result, choose the template you prefer
and Open as Template to own a copy yourself to edit freely. To learn more about Overleaf, please refer to
Documentation.
Remark On Overleaf, please use XƎLATEX to compile articles in Chinese and pdfLATEX to compile articles in
English.
3.3 About Pull Request

3.2.2 To Use Portable Version


For portable version, simply download lastest ElegantBook-master from GitHub or CTAN (to be more
accurate, download elegantbook.cls) and save the file(s) under your working directory. This way of installation
is simple and convenient, but you have to manually update cls now and then.

3.2.3 Update Templates


If you fail to update templates using tlshell , please use cmd to update all the packages or switch to portable
version instead.
Use the following commands(administrator privileges) to update:
tlmgr update -- self
tlmgr update -- all

To learn more, please refer to How do I update my TEX distribution?

3.2.4 Other Release Versions


If you are a TEX Live 2018/2019/2020 user and would like to update, the official solution is to unin-
stall the previous version. If you want to save the bother of uninstallation and re-installation, please copy
elegantbook.cls to the installation directory of TEX Live 2021 (default: C:\texlive\2021\texmf-dist\tex
\latex\elegantbook ), run texhash in cmd.

3.3 About Pull Request


For some reasons, pull requests will NOT by accepted since May 20, 2019. For those who want to help
improve the templates, submit issues or clone to your own repository to modify under LPPL-1.3c.

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.

4.2 Device Mode Option


The option for device (device) was originally used in ElegantNote, now we include this option in Elegant-
Book1 as well. Activate iPad mode in the following way2 :
\documentclass[pad]{elegantbook} %or
\documentclass[device=pad]{elegantbook}

4.3 Color Themes


This template contains 5 color themes, i.e. green3 , cyan, blue(default), gray, black. You can choose green
with
1
Pictures have to be modified accordingly.
2
Default size: normal, A4 paper.
3
Original default theme.
4.4 Cover

\documentclass[green]{elegantbook} %or
\documentclass[color=green]{elegantbook}

Table 4.1: ElegantBook Themes


green cyan blue gray black Main Environments

structure chapter section subsection

main definition exercise problem

second theorem lemma corollary

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

4.4.1 Customized Cover


From v3.10, customized cover is allowed, you can choose or hide any element as you prefer. Current
optional elements are:
title: \title
subtitle: \subtitle
author: \author
institute: \institute
date: \date
version: \version
extra information: \extrainfo
cover image: \cover
logo: \logo
Besides, an extra command \bioinfo is provided with two options–caption and content. For instance, if
you want to display Username: 111520, just type in
\bioinfo{Username}{115520}

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.2 Cover Image


The cover image used in this template is from pixabay.com. The image is completely free and can be used
under any circumstance. The cover image size is 1280 × 1024. If you would like to change the cover, please
crop it according to the size of the cover picture strictly. One free online image clipping site: fotor.com. Feel
free to join our QQ Group to get more elegant covers.

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.

4.4.4 Stylized Cover


Want to use stylized cover?(For instance, A4-sized PDF designed by Adobe Illustrator) Please comment
out \maketitle and use pdfpages to insert the cover. Similar for using titlepage . If you would like to use the
cover in version 2.x, please refer to etitlepage.

4.5 Chapter Title Display Styles


This template contains 2 sets of title display styles,hang(default) and display style. For the former, chapter
title is displayed on a single line (hang). For the latter, chapter title is displayed on a double line (display).In
this guide, we use hang . To change display style, use:
\documentclass[hang]{elegantbook} %or
\documentclass[ titlestyle =hang]{elegantbook}

4.6 Introduction of Math Environments


We defined two sets of theorem modes, simple style and fancy style (default). You may change to simple
mode by
\documentclass[simple]{elegantbook} %or
\documentclass[mode=simple]{elegantbook}

In this template, we defined four different theorem class environments


Theorem Environment, including title and content, numbering corresponding to chapter. Three types
depending on the format:
definition environment, the color is main;
theorem, lemma, corollary environment, the color is second;
proposition environment, the color is third.

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.

4.6.1 Theorem Class Environments


Since the template uses the tcolorbox package to customize the theorem class environments, it is slightly
different from the normal theorem environments. The usage is as follows:
\begin{theorem}{theorem name}{label text}
The content of theorem.
\end{theorem}

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}

Other theorem class environments with the same usage includes:

Table 4.2: Theorem Class Environments


Environment Label text Prefix Cross-reference
definition label def \ref{def: label}
theorem label thm \ref{thm:label}
lemma label lem \ref{lem:label}
corrlary label cor \ref{cor: label}
proposition label pro \ref{pro:label}

4.6.2 Other Customized Environments


The other three math environments can be called directly since there are no additional option for them, e.g.
example:
\begin{example}
This is the content of example environment.

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}

The effect is as follows:


Example 4.1 This is the content of example environment.
These are all similar environments with slight differences lies in:
Example, exercise, problem environments number within chapter;
Note begins with introductory symbol and proof ends with ending symbol;
Conclusion and other environments are normal paragraph environments with boldfaced introductory
words.

4.7 List Environments


This template uses tikz to customize the list environments, with itemize environment customized to the
third depth and enumerate environment customized to fourth depth. The effect is as follows
first item of nesti; 1. first item of nesti;
second item of nesti; 2. second item of nesti;
first item of nestii; (a). first item of nestii;
second item of nestii; (b). second item of nestii;
first item of nestiii; I. first item of nestiii;
second item of nestiii. II. second item of nestiii.

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}

4.8.1 Symbol Fonts


Feedback from some 3.08 users claims that error occurs when using our templates with yhmath, esvect
and other packages.

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

%%% use esvect pkg, uncomment following code


% \RequirePackage{esvect}

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.

4.11 Content Option and Depth


Option for content toc, you can choose either one column(onecol) or two columns(twocol). For two
columns:
\documentclass[twocol]{elegantbook}
\documentclass[toc=twocol]{elegantbook}

Default content depth is 1, use to use \setcounter{tocdepth}{2}.

13
4.12 Introduction Environment

4.12 Introduction Environment


We create a introduction environment to display the structure of chapter. The basic useage is as follows:
\begin{introduction}
\item Definition of Theorem
\item Ask for help
\item Optimization Problem
\item Property of Cauchy Series
\item Angle of Corner
\end{introduction}

And you will get:

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}

And you will get:

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

4.13 Margin Notes


In 3.08, we introduced marginpar=margintrue and \elegantpar (Beta) with piles of bugs. Hence we
decide to remove them in 3.09 and will suspend the options till revolutionary optimization. Sorry for all the bugs!
However, we retain the option marginpar for users to get margin motes by activating marginpar=margintrue
and using \marginpar or marginnote packages.
Remark Note that text and equation are both available in the margin notes.
% text
\marginpar{margin paragraph text}

% 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}
}

% graph with center environment


\marginpar{
\begin{center}
\includegraphics[width=0.2\textwidth]{logo.png}
\captionof{figure}{your figure caption}
\end{center}
}

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 Writing Sample


We will define the integral of a measurable function in three steps. First, we define the integral of a non-
negative simple function. Let E be the measurable set in RN .
Definition 5.1 (Left Coset)
Let H be a subgroup of a group G. A left coset of H in G is a subset of G that is of the form xH, where
x ∈ G and xH = {xh : h ∈ H}. Similarly a right coset of H in G is a subset of G that is of the form
Hx, where Hx = {hx : h ∈ H} ℏ


Note Note that a subgroup H of a group G is itself a left coset of H in G.
Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi auctor lorem non justo. Nam
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.
Theorem 5.1 (Lagrange’s Theorem)
Let G be a finite group, and let H be a subgroup of G. Then the order of H divides the order of G.

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

Proposition 5.1 (Size of Left Coset)


Let H be a finite subgroup of a group G. Then each left coset of H in G has the same number of elements
as H. ♠

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.

Figure 5.1: Matplotlib: Scatter Plot Example

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.

5.2 Second section


This second section may include some special word, and expand the ones already used.
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.
Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi auctor lorem non justo. Nam

17
Chapter 5 Exercise

Table 5.1: Auto MPG and Price


(1) (2)
mpg -238.90*** -49.51
(53.08) (86.16)
weight 1.75***
(0.641)
constant 11,253*** 1,946
(1,171) (3,597)
obs 74 74
R2 0.220 0.293
Standard errors in parentheses
*** p<0.01, ** p<0.05, * p<0.1

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 list some FAQs for users to refer to:


1. Why option numbers for natbib fail to take effect in v3.07?
In v3.07, when gbt7714 is introduced, option authoryear is incompatible with natbib. In v3.08 and
3.09, numbers, numbers, super and authoryear are introduced.
2. I want to customize font and background color.
Please use pagecolor to change background color, refer to this to customize font.
3. Which version should I choose?
Please use Latest Release via GitHub or TEX Live 2021.
4. Which editor should I choose?
You can use TEX Live 2021 built-in TEXworks or TEXStudio. You may refer to TEXworks autocomplete.
TEX Live 2021 + TEXstudio is strongly recommended. I myself use VS Code and Sublime Text. Related
configurations can be found at vscode-latex and sublime-text-latex.
5. Hello, we want to use ElegantBook to write a book about machine learning and would like your autho-
rization.
Feel free to use our templates by pointing out our copyright. For other issues, please refer to LPPL-1.3c.
If you want to show us your work, share the URL with us afterwards.
6. What is cross reference?
This template is aimed at who are not a complete beginner for LATEX. Please learn more about LATEX
before using this template.
7. Is the language for code highlighting optional?
Yes, listings package is used in ElegantBook, hence language is optional(e.g. language=Python). For
global setting, use lstset . For more information, please refer to package documentations.
8. When will Beamer template (ElegantSlide or ElegantBeamer) forthcoming?
Since there is an excellent theme Metropolis, no plan for Beamer theme.
Chapter 7 Version History

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.

2021/05/02 Updates:release of v4.1.


1 ! Big Change: Change the bibliography method from BIBTEX to biblatex(with backend biber);
2 ! Big Change: Add support for the default theorem writing method (with optional name and label);
3 Add left and right space;
4 Support hyperlink from the text of TOC;
5 Remove the pdfLATEX compatiblity check for Chinese.
6 Add multilingual support, for french lang=fr, dutch lang=nl, Hungarian lang=hu, Spanish lang=es,
Mongolian lang=mn etc.

2020/04/12 Updates:release of v3.11, LAST version of 3.x.


1 ! Fix: Fix natbib option clash problems caused by gbt7714 updates.
2 Remove base decorations and its options since pgfornament package is not included in TEX Live 2020.
3 Fix spacing problem in some environments.
4 Introduce language option for Italian, lang=it.

2020/02/10 Updates:release of v3.10


1 Introduce math for math font, optional styles are newtx and cm.
Notice: The math font newtxmath in previous versions is reset to default LATEX math font, to keep pre-
vious math font, please declare math=newtx.
2 Introduce chinesefont option, with founder, ctexfont and nofont available.
3 Turn author information on the cover optional and add customized command \bioinfo.
4 Add version history with command \datechange and environment change.
5 Add Chinese chapter style scheme with option chinese.
6 Since the bug raised by \lvert is fixed, exchange package positions of ctex and amsmath.
7 Drop \lastpage from header to avoid page anchor bug and adding \frontmatter.
8 Revise bibliography option cite with optional styles numbers,authoryear and super.
9 Introduce bibliography style option bibstyle , with default bib style apalike for English mode and gbt
7714 package for Chinese mode.

2019/08/18 Updates:release of v3.09


1 Remove \elegantpar temporary and remind users to use \marginnote and \marginpar instead.
2 Use esint to display integral operator.
3 Add new command toc, with options onecol and twocol.
4 Add new option cite super for superscript-displayed citation.
5 Revise problemset.
Bibliography

[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.

A.1 Summation Operator and Description Statistics


Summation Operator is an abbreviation used to express the summation of numbers, it plays an important
role in statistics and econometrics analysis. If {xi : i = 1, 2, . . . , n} is a sequence of n numbers, the summation
of the n numbers is:


n
xi ≡ x1 + x2 + · · · + xn (A.1)
i=1

You might also like