<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Discrete Math on</title><link>https://notes.bencuan.me/cs70/discrete-math/</link><description>Recent content in Discrete Math on</description><generator>Hugo</generator><language>en</language><atom:link href="https://notes.bencuan.me/cs70/discrete-math/index.xml" rel="self" type="application/rss+xml"/><item><title>Discrete Math Overview</title><link>https://notes.bencuan.me/cs70/discrete-math/overview/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://notes.bencuan.me/cs70/discrete-math/overview/</guid><description>&lt;h2 id="what-even-is-discrete-math"&gt;
 What even is discrete math?
 &lt;a class="anchor" href="#what-even-is-discrete-math"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;According to 
&lt;a href="https://en.wikipedia.org/wiki/Discrete%5c_mathematics" rel="noopener"&gt;Wikipedia&lt;/a&gt;, &amp;ldquo;&lt;em&gt;Discrete mathematics&lt;/em&gt; is the study of mathematical structures that are fundamentally discrete rather than continuous.&amp;rdquo; Very helpful, thank you Wikipedia. The floor is indeed made of floor rather than sky.&lt;/p&gt;
&lt;p&gt;The word &lt;strong&gt;discrete&lt;/strong&gt; means &amp;ldquo;distinct&amp;rdquo; or &amp;ldquo;countable&amp;rdquo;. This suggests that discrete math has to do with &lt;strong&gt;countable numbers&lt;/strong&gt; like integers, rather than the continuous $f(x)$functions we&amp;rsquo;re used to seeing that are defined for any real$x$, even ones we don&amp;rsquo;t know the exact value of like $\pi$.&lt;/p&gt;</description></item><item><title/><link>https://notes.bencuan.me/cs70/discrete-math/propositional-logic/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://notes.bencuan.me/cs70/discrete-math/propositional-logic/</guid><description>&lt;h2 id="what-are-propositions"&gt;
 What are Propositions?
 &lt;a class="anchor" href="#what-are-propositions"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Propositions are anything that can be &lt;strong&gt;true&lt;/strong&gt; or &lt;strong&gt;false.&lt;/strong&gt; This could include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Statements like &amp;ldquo;Birds can fly&amp;rdquo;.&lt;/li&gt;
&lt;li&gt;Well defined equations with no free variables like $1 + 1 = 3$.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Propositions are &lt;strong&gt;not:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Variables like $x$ or $5$.&lt;/li&gt;
&lt;li&gt;Equations with free variables like $P(x) = y$.&lt;/li&gt;
&lt;li&gt;Statements that aren&amp;rsquo;t clearly true or false, like &amp;ldquo;I like trains.&amp;rdquo;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="connectives"&gt;
 Connectives
 &lt;a class="anchor" href="#connectives"&gt;#&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;Simple propositions can be &lt;strong&gt;joined together&lt;/strong&gt; to make complex statements. There are three basic ways to connect propositions together:&lt;/p&gt;</description></item><item><title/><link>https://notes.bencuan.me/cs70/discrete-math/proofs/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://notes.bencuan.me/cs70/discrete-math/proofs/</guid><description>&lt;h2 id="introduction"&gt;
 Introduction
 &lt;a class="anchor" href="#introduction"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;A &lt;strong&gt;proof&lt;/strong&gt; is a &lt;strong&gt;set of logical deductions&lt;/strong&gt; that can be used to show how something is true. This is powerful because proofs can often be very &lt;strong&gt;general,&lt;/strong&gt; allowing a truth to be used in a whole bunch of cases that don&amp;rsquo;t individually need to be re-proven.&lt;/p&gt;
&lt;p&gt;There are a number of common proof techniques (although these certainly aren&amp;rsquo;t exhaustive!) outlined below.&lt;/p&gt;
&lt;h2 id="direct-proofs"&gt;
 Direct Proofs
 &lt;a class="anchor" href="#direct-proofs"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;In direct proofs, we can use the &lt;strong&gt;definitions&lt;/strong&gt; directly to show that something is true. No trickery here, just straightforward navigation from point A to point B.&lt;/p&gt;</description></item><item><title/><link>https://notes.bencuan.me/cs70/discrete-math/stable-matching/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://notes.bencuan.me/cs70/discrete-math/stable-matching/</guid><description>&lt;h2 id="introduction"&gt;
 Introduction
 &lt;a class="anchor" href="#introduction"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;The &lt;strong&gt;stable matching problem&lt;/strong&gt; deals with how to match one group to another group while trying to maximize everyone&amp;rsquo;s &amp;lsquo;happiness&amp;rsquo;.&lt;/p&gt;
&lt;p&gt;It works best when the two groups are &lt;strong&gt;distinct&lt;/strong&gt; \(nobody can be in both groups at once\) and the orderings are &lt;strong&gt;complete&lt;/strong&gt; \(everyone in the other group has to show up in all orderings\). Before we get to examples of when this might apply, I&amp;rsquo;ll throw out a few examples where we &lt;strong&gt;can&amp;rsquo;t&lt;/strong&gt; use this algorithm so you don&amp;rsquo;t get any wrong ideas:&lt;/p&gt;</description></item><item><title/><link>https://notes.bencuan.me/cs70/discrete-math/graphs/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://notes.bencuan.me/cs70/discrete-math/graphs/</guid><description>&lt;blockquote&gt;
&lt;p&gt;[!info] Content Note&lt;/p&gt;
&lt;p&gt;This is a second introduction to graphs that assumes you&amp;rsquo;ve at least seen them before. Take a look at the 





&lt;a href="https://notes.bencuan.me/cs61b/abstract-data-types/graphs/" rel="noopener"
 class="internal-link" data-src="https://notes.bencuan.me/cs61b/abstract-data-types/graphs/"&gt;61B version&lt;/a&gt; if you feel lost!&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id="whats-a-graph"&gt;
 What&amp;rsquo;s a graph?
 &lt;a class="anchor" href="#whats-a-graph"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Formally, a graph is a &lt;strong&gt;set of vertices with a set of edges connecting them.&lt;/strong&gt; A graph can be defined as $G = (V, E)$ where $V = \{A, B, \cdots V_n\}$ and $E = \{\{A, B\}, \{B, C\} \cdots \}$ (For algorithmic treatments of the same structures — BFS/DFS, SCCs, MSTs, shortest paths — see [[cs170/Graphs]].)&lt;/p&gt;</description></item><item><title>Modular Arithmetic</title><link>https://notes.bencuan.me/cs70/discrete-math/modular-arithmetic/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://notes.bencuan.me/cs70/discrete-math/modular-arithmetic/</guid><description>&lt;h2 id="what-is-modular-arithmetic"&gt;
 What is Modular Arithmetic?
 &lt;a class="anchor" href="#what-is-modular-arithmetic"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Modular arithmetic is &amp;ldquo;clock math&amp;rdquo; - that is, when numbers wrap around back to 0 if they get too big. You could think about it like a &lt;strong&gt;remainder:&lt;/strong&gt; $21 \pmod{10}$ for example can be read as &amp;ldquo;what is the remainder of 21 when it is divided by 10?&amp;rdquo; (it&amp;rsquo;s 1, by the way.)&lt;/p&gt;
&lt;p&gt;This is an important concept in many aspects of computer science, namely 





&lt;a href="https://notes.bencuan.me/cs70/discrete-math/rsa-cryptography/" rel="noopener"
 class="internal-link" data-src="https://notes.bencuan.me/cs70/discrete-math/rsa-cryptography/"&gt;cryptography&lt;/a&gt; and 





&lt;a href="https://notes.bencuan.me/cs70/discrete-math/polynomials/" rel="noopener"
 class="internal-link" data-src="https://notes.bencuan.me/cs70/discrete-math/polynomials/"&gt;error correction&lt;/a&gt; among many others. It also underlies fixed-width integer arithmetic in machine code — see [[cs61b/misc-topics/modular-arithmetic]] — and the symmetric/asymmetric primitives studied in [[cs161/Cryptography]].&lt;/p&gt;</description></item><item><title>RSA Cryptography</title><link>https://notes.bencuan.me/cs70/discrete-math/rsa-cryptography/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://notes.bencuan.me/cs70/discrete-math/rsa-cryptography/</guid><description>&lt;h2 id="introduction"&gt;
 Introduction
 &lt;a class="anchor" href="#introduction"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;The internet is built upon the fact that stuff needs to go from point A to point B quickly, accurately, and securely. We&amp;rsquo;ll talk about the &lt;strong&gt;secure&lt;/strong&gt; part of that now (the accurate part will be addressed 





&lt;a href="https://notes.bencuan.me/cs70/discrete-math/polynomials/" rel="noopener"
 class="internal-link" data-src="https://notes.bencuan.me/cs70/discrete-math/polynomials/"&gt;soon&lt;/a&gt;!).&lt;/p&gt;
&lt;p&gt;One of the ways we can make sure our top-secret messages can&amp;rsquo;t get intercepted is to &lt;strong&gt;encrypt&lt;/strong&gt; them- mix them up to become incomprehensible using some secret code, then decrypt it at the other end. This has a major problem though- how can you agree to use the same secret code as someone else if you&amp;rsquo;ve never met them before?&lt;/p&gt;</description></item><item><title>Polynomials</title><link>https://notes.bencuan.me/cs70/discrete-math/polynomials/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://notes.bencuan.me/cs70/discrete-math/polynomials/</guid><description>&lt;h2 id="introduction"&gt;
 Introduction
 &lt;a class="anchor" href="#introduction"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;&amp;ldquo;I learned this in 4th grade&amp;rdquo;, you say, &amp;ldquo;and I already know how to do Taylor approximations and binomial expansions and get local minima&amp;hellip; what else is there to do?&amp;rdquo; (At least that was my first thought :stuck_out_tongue:)&lt;/p&gt;
&lt;p&gt;Turns out, polynomials are super useful in the world of discrete math. Here, we&amp;rsquo;ll cover two applications in discrete space, which are &lt;strong&gt;secret sharing&lt;/strong&gt; and &lt;strong&gt;error correction.&lt;/strong&gt;&lt;/p&gt;
&lt;h3 id="important-properties"&gt;
 Important Properties
 &lt;a class="anchor" href="#important-properties"&gt;#&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;Gotta do some quick review first! Recall that all polynomials are in the form&lt;/p&gt;</description></item><item><title>Countability</title><link>https://notes.bencuan.me/cs70/discrete-math/countability/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://notes.bencuan.me/cs70/discrete-math/countability/</guid><description>&lt;p&gt;


&lt;img src="https://notes.bencuan.me/cs70/discrete-math/../img/assets/image%20%2817%29.png" width="auto" alt="But Buzz&amp;hellip; which kind of infinity :?" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;How big is infinity? Are some infinities bigger than others?&lt;/strong&gt; The $\infty$is a rather mind-boggling concept; the principles of countability will hopefully make some sense out of it.&lt;/p&gt;
&lt;h2 id="bijections"&gt;
 Bijections
 &lt;a class="anchor" href="#bijections"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;A &lt;strong&gt;bijection&lt;/strong&gt; is a mapping between two sets such that there &lt;strong&gt;exists&lt;/strong&gt; a &lt;strong&gt;unique&lt;/strong&gt; pairing from a particular element of one set to another.&lt;/p&gt;
&lt;p&gt;These ideas of &lt;strong&gt;existence&lt;/strong&gt; and &lt;strong&gt;uniqueness&lt;/strong&gt; can be formalized by considering some different types of maps:&lt;/p&gt;</description></item><item><title>Computability</title><link>https://notes.bencuan.me/cs70/discrete-math/computability/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://notes.bencuan.me/cs70/discrete-math/computability/</guid><description>&lt;p&gt;Computability is the study of a massively important question: &lt;strong&gt;do there exist any problems that are impossible for a computer to solve?&lt;/strong&gt;&lt;/p&gt;
&lt;h2 id="the-halting-problem"&gt;
 The Halting Problem
 &lt;a class="anchor" href="#the-halting-problem"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;It turns out that the above question itself is impossible to solve: in other words, &lt;strong&gt;there cannot exist a program HALT which determines if a program can halt in finite time given a particular input.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This was originally proposed by Alan Turing- he proved the nonexistence by attempting to feed the Halting Problem into itself: if the Halting Problem doesn&amp;rsquo;t halt, then it is supposed to output an answer. That means that the Halting Problem would state that the Halting Problem halts, even though it didn&amp;rsquo;t. This paradox led to demonstrating that the Halting Problem simply cannot be solved.&lt;/p&gt;</description></item></channel></rss>