<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>mathematics | Mohammad Moshtaghi</title>
    <link>https://mhmmoshtaghi.github.io/tag/mathematics/</link>
      <atom:link href="https://mhmmoshtaghi.github.io/tag/mathematics/index.xml" rel="self" type="application/rss+xml" />
    <description>mathematics</description>
    <generator>Wowchemy (https://wowchemy.com)</generator><language>en-us</language><copyright>© 2023 Mohammad Moshtaghi</copyright><lastBuildDate>Tue, 30 Nov 2021 11:57:40 -0700</lastBuildDate>
    <image>
      <url>https://mhmmoshtaghi.github.io/media/logo_hu1dc8deb1865675db905a286e8af9308b_16380_300x300_fit_lanczos_3.png</url>
      <title>mathematics</title>
      <link>https://mhmmoshtaghi.github.io/tag/mathematics/</link>
    </image>

    <item>
      <title>Elegant Derivatives of Large Products</title>
      <link>https://mhmmoshtaghi.github.io/post/elegant-derivatives-of-large-products/</link>
      <pubDate>Tue, 30 Nov 2021 11:57:40 -0700</pubDate>
      <guid>https://mhmmoshtaghi.github.io/post/elegant-derivatives-of-large-products/</guid>
      <description>&lt;p&gt;An ongoing research project on modeling computer security has thrown me back into calculus for the first time since my undergraduate differential equations course in 2014, which as an aside was the only college course that forced me to buy the professor&amp;rsquo;s custom textbook just to get access to homework problems.
(I&amp;rsquo;m still mad about that.)
Anyway, my research led me to take the derivative of an expression of the form:&lt;/p&gt;
&lt;p&gt;$$\prod_{i=1}^n f_i(x)$$&lt;/p&gt;
&lt;p&gt;For the uninitiated, $\prod$ is a mathematical symbol meaning &amp;ldquo;product&amp;rdquo; (and is analogous to the $\sum$ symbol meaning &amp;ldquo;sum&amp;rdquo;).
It says to look at each $f_i$ term as $i$ goes from $1, 2, \ldots, n$ and multiply them all together:&lt;/p&gt;
&lt;p&gt;$$\prod_{i=1}^n f_i(x) = f_1(x) \times f_2(x) \times \cdots \times f_n(x)$$&lt;/p&gt;
&lt;p&gt;Taking this derivative is something high-school me was much better prepared for than current postdoc me, but after some head scratching I found the elegant solution:&lt;/p&gt;
&lt;p&gt;$$\frac{d}{dx} \prod_{i=1}^n f_i(x) = \prod_{i=1}^n f_i(x) \cdot \sum_{i=1}^n \frac{f_i&#39;(x)}{f_i(x)}$$&lt;/p&gt;
&lt;p&gt;As is common in mathematics, there&amp;rsquo;s a direct but tedious way to get this answer and another more elegant way to get the same thing.
I&amp;rsquo;m not the first to derive this solution, but I&amp;rsquo;m writing it up for posterity because I will inevitably forget this trick in a few days.
A PDF of the two derivations without all the handholding I&amp;rsquo;m about to do is available &lt;a href=&#34;https://mhmmoshtaghi.github.io/uploads/elegant-derivatives-of-large-products.pdf&#34; target=&#34;_blank&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;method-1-product-rule&#34;&gt;Method 1: Product Rule&lt;/h2&gt;
&lt;p&gt;I had to sweep away years of mental cobwebs to remember the &lt;a href=&#34;https://en.wikipedia.org/wiki/Product_rule&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;product rule&lt;/a&gt; for derivatives.
My expression is a product, after all, so why not start there?
The product rule states:&lt;/p&gt;
&lt;p&gt;$$\frac{d}{dx}(u \cdot v) = u&#39; \cdot v + u \cdot v&#39;$$&lt;/p&gt;
&lt;p&gt;This works for the product of two terms, but $\prod_{i=1}^n f_i(x)$ has $n$ terms.
Let&amp;rsquo;s try peeling off terms one-by-one, starting with $f_1(x)$, and then applying the product rule.&lt;/p&gt;
&lt;p&gt;$$\begin{align*}
\frac{d}{dx} \prod_{i=1}^n f_i(x) &amp;amp;= \frac{d}{dx} \left(f_1(x) \cdot \prod_{i=2}^n f_i(x)\right) \\
&amp;amp;= f_1&#39;(x) \cdot \prod_{i=2}^n f_i(x) + f_1(x) \cdot \frac{d}{dx} \left(\prod_{i=2}^n f_i(x)\right)
\end{align*}$$&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s progress, but now we have to repeat the process to deal with the $\frac{d}{dx} \left(\prod_{i=2}^n f_i(x)\right)$ term, peeling off $f_2(x)$ and applying the product rule again:&lt;/p&gt;
&lt;p&gt;$$\begin{align*}
\frac{d}{dx} \prod_{i=1}^n f_i(x) &amp;amp;= f_1&#39;(x) \cdot \prod_{i=2}^n f_i(x) + f_1(x) \cdot \frac{d}{dx} \left(\prod_{i=2}^n f_i(x)\right) \\
&amp;amp;= f_1&#39;(x) \cdot \prod_{i=2}^n f_i(x) + f_1(x) \\
&amp;amp;\quad \cdot \left(f_2&#39;(x) \cdot \prod_{i=3}^n f_i(x) + f_2(x) \cdot \frac{d}{dx} \left(\prod_{i=3}^n f_i(x)\right)\right)
\end{align*}$$&lt;/p&gt;
&lt;p&gt;This expression&amp;rsquo;s going to have &lt;a href=&#34;https://media.giphy.com/media/22eVpVYpRhaE0/giphy.gif&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;more layers than an ogre&lt;/a&gt;!
If we were to do the peel-and-product rule strategy $n-1$ times, we would arrive at:&lt;/p&gt;
&lt;p&gt;$$\begin{align*}
\frac{d}{dx} \prod_{i=1}^n f_i(x) &amp;amp;= f_1&#39;(x) \cdot \prod_{i=2}^n f_i(x) + f_1(x) \\
&amp;amp;\quad \cdot \left(f_2&#39;(x) \cdot \prod_{i=3}^n f_i(x) + f_2(x) \right. \\
&amp;amp;\quad \cdot \left(f_3&#39;(x) \cdot \prod_{i=4}^n f_i(x) + f_3(x) \cdots + f_{n-2}(x) \right. \\
&amp;amp;\quad \left. \left. \cdot \left(f_{n-1}&#39;(x) \cdot f_n(x) + f_n&#39;(x) \cdot f_{n-1}(x)\right) \cdots \right) \right)
\end{align*}$$&lt;/p&gt;
&lt;p&gt;Do you see the pattern?
If we distribute the $f_i(x)$ terms at the end of each of the lines above into the parentheses that immediately follow,&lt;/p&gt;
&lt;p&gt;$$\begin{align*}
\frac{d}{dx} \prod_{i=1}^n f_i(x) &amp;amp;= f_1&#39;(x) \cdot \prod_{i=2}^n f_i(x) + f_2&#39;(x) \cdot f_1(x) \cdot \prod_{i=3}^n f_i(x) \\
&amp;amp;\quad + f_3&#39;(x) \cdot f_1(x) \cdot f_2(x) \cdot \prod_{i=4}^n f_i(x) \\
&amp;amp;\quad + f_{n-1}&#39;(x) \cdot f_1(x) \cdots f_{n-2}(x) \cdot f_n(x) \\
&amp;amp;\quad + f_n&#39;(x) \cdot f_1(x) \cdots f_{n-1}(x)
\end{align*}$$&lt;/p&gt;
&lt;p&gt;We&amp;rsquo;re adding up a bunch of terms, each of which is a derivative $f_i&#39;(x)$ multiplied by all the other $f_j(x)$&amp;rsquo;s, where $j \neq i$.
Landing this messy, notation-heavy plane, we can rewrite this long sum as&lt;/p&gt;
&lt;p&gt;$$\frac{d}{dx} \prod_{i=1}^n f_i(x) = \sum_{i=1}^n f_i&#39;(x) \cdot \frac{\prod_{j=1}^n f_j(x)}{f_i(x)}
= \prod_{i=1}^n f_i(x) \cdot \sum_{i=1}^n \frac{f_i&#39;(x)}{f_i(x)},$$&lt;/p&gt;
&lt;p&gt;which is the solution we came for.&lt;/p&gt;
&lt;h2 id=&#34;method-2-leveraging-logarithms&#34;&gt;Method 2: Leveraging Logarithms&lt;/h2&gt;
&lt;p&gt;Mathematicians crave elegance, and Method 1 wasn&amp;rsquo;t that.
We had to keep keen eyes out for patterns as they emerged and carefully distribute/rearrange many terms to get the solution.
This second method will be much cleaner, but as many clever methods do, it begins with an unintuitive step.&lt;/p&gt;
&lt;p&gt;Let $F(x) = \prod_{i=1}^n f_i(x)$.
Taking the &lt;a href=&#34;https://en.wikipedia.org/wiki/Natural_logarithm&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;natural logarithm&lt;/a&gt; of both sides,&lt;/p&gt;
&lt;p&gt;$$\ln(F(x)) = \ln\left(\prod_{i=1}^n f_i(x)\right) = \sum_{i=1}^n \ln(f_i(x)),$$&lt;/p&gt;
&lt;p&gt;where the last equality follows from the fact that the logarithm of a product is equal to the sum of logarithms.
The derivative of the natural logarithm is:&lt;/p&gt;
&lt;p&gt;$$\frac{d}{dx}\ln(x) = \frac{1}{x}$$&lt;/p&gt;
&lt;p&gt;Using &lt;a href=&#34;https://en.wikipedia.org/wiki/Chain_rule&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;chain rule&lt;/a&gt; to take the derivative of both sides of the above equality,&lt;/p&gt;
&lt;p&gt;$$\begin{align*}
\frac{d}{dx}\ln(F(x)) &amp;amp;= \frac{d}{dx}\sum_{i=1}^n \ln(f_i(x)) \\
\frac{1}{F(x)} \cdot \frac{dF}{dx} &amp;amp;= \sum_{i=1}^n \frac{1}{f_i(x)} \cdot f_i&#39;(x) \\
\frac{dF}{dx} &amp;amp;= F(x) \cdot \sum_{i=1}^n \frac{f_i&#39;(x)}{f_i(x)}
\end{align*}$$&lt;/p&gt;
&lt;p&gt;If we plug $F(x) = \prod_{i=1}^n f_i(x)$ back in, out pops the solution:&lt;/p&gt;
&lt;p&gt;$$\frac{d}{dx} \prod_{i=1}^n f_i(x) = \prod_{i=1}^n f_i(x) \cdot \sum_{i=1}^n \frac{f_i&#39;(x)}{f_i(x)}$$&lt;/p&gt;
&lt;h2 id=&#34;concluding-thoughts&#34;&gt;Concluding Thoughts&lt;/h2&gt;
&lt;p&gt;Having initially stumbled upon Method 1, I was surprised that this derivative came out so beautifully in the end.
Credit where it&amp;rsquo;s due: I adapted the elegant Method 2 from &lt;a href=&#34;https://www.quora.com/What-is-the-first-derivative-of-an-infinite-product-of-factors&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;this post&lt;/a&gt; regarding infinite products.
I have some technical notes at the end of the &lt;a href=&#34;https://mhmmoshtaghi.github.io/uploads/elegant-derivatives-of-large-products.pdf&#34; target=&#34;_blank&#34;&gt;linked PDF&lt;/a&gt; about when Method 2 breaks down, though I believe Method 1 does not have any of these problems.&lt;/p&gt;
&lt;p&gt;Hopefully this was fun (and if it wasn&amp;rsquo;t, I doubt you read this far 😉).
This is one of many examples in mathematics of finding multiple solutions to the same problem and learning something different each time.
Next time you emerge victorious from a tedious derivation, see if you can find a clever alternative!&lt;/p&gt;
</description>
    </item>

    <item>
      <title>Solving the Molecube by Reduction</title>
      <link>https://mhmmoshtaghi.github.io/post/solving-the-molecube-by-reduction/</link>
      <pubDate>Mon, 06 Jan 2020 13:00:00 -0700</pubDate>
      <guid>https://mhmmoshtaghi.github.io/post/solving-the-molecube-by-reduction/</guid>
      <description>&lt;p&gt;My sister-in-law surprised me with a &lt;a href=&#34;http://www.recenttoys.com/meffert-molecube-twister-puzzle/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Molecube&lt;/a&gt; for Christmas, which combines the logic of a Sudoku puzzle with the mechanics of a Rubik&amp;rsquo;s cube. Each ball on the Molecube is one of nine colors, and the goal is to reconfigure a shuffled Molecube so each of its faces has all nine colors on it.&lt;/p&gt;














&lt;figure  &gt;
  &lt;div class=&#34;d-flex justify-content-center&#34;&gt;
    &lt;div class=&#34;w-100&#34; &gt;&lt;img src=&#34;http://www.recenttoys.com/wp-content/uploads/2019/11/meffert-molecube-twister-puzzle-1200x900.jpg&#34; alt=&#34;&#34; loading=&#34;lazy&#34; data-zoomable width=&#34;65%&#34; /&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;/figure&gt;
&lt;p&gt;It turns out that solving the Molecube is a wonderful exercise in what computer scientists call &lt;em&gt;reduction&lt;/em&gt;, which involves transforming a problem we don&amp;rsquo;t know how to solve into one that we do, solving that version, and then translating the solution back into the original problem. In this post, I&amp;rsquo;ll give a reader-friendly primer on reduction, outline a reduction from the Molecube to the Rubik&amp;rsquo;s cube, and then wrap up by solving the Molecube with a standard Rubik&amp;rsquo;s cube algorithm.&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re interested in solving the Molecube yourself (and perhaps you&amp;rsquo;re here looking for hints), I&amp;rsquo;ve created a &lt;a href=&#34;https://mhmmoshtaghi.github.io/files/molecube_worksheet.pdf&#34; target=&#34;_blank&#34;&gt;worksheet&lt;/a&gt; you can use and will point out when you should skip ahead in the post so as to avoid spoiling this delightful puzzle.&lt;/p&gt;
&lt;h2 id=&#34;reduction-there-and-back-again&#34;&gt;Reduction: There and Back Again&lt;/h2&gt;
&lt;p&gt;Say we have a problem $A$ that we don&amp;rsquo;t know how to solve and another problem $B$ that we do know how to solve. Said another way, we have an &amp;ldquo;algorithm&amp;rdquo; that can answer any question asked in the form of problem $B$, but we have no such algorithm for problem $A$ questions. The whole idea of reduction is to:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Take a problem $A$ question (which we don&amp;rsquo;t know how to answer) and &amp;ldquo;transform&amp;rdquo; it into a problem $B$ question (which we do know how to answer).&lt;/li&gt;
&lt;li&gt;Use the &amp;ldquo;algorithm&amp;rdquo; for problem $B$ questions to get an answer for our transformed problem $A$ question.&lt;/li&gt;
&lt;li&gt;Translate the algorithm&amp;rsquo;s answer back into the context of problem $A$.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;That&amp;rsquo;s it. We use a known algorithm (for problem $B$) as our workhorse for a new and unknown problem (problem $A$), and out pop solutions for our unknown problem! This powerful technique underlies almost all of theoretical computer science, giving us a tool to relate difficult problems to one another (as opposed to treating every new problem as something totally unique). I recently heard a high-profile professor in Computer Science claim that reduction is one of only two truly new ideas our discipline has ever contributed to science (though she called this idea &amp;ldquo;hierarchy&amp;rdquo;, with the other idea being &amp;ldquo;abstraction&amp;rdquo;).&lt;/p&gt;
&lt;p&gt;A natural question to ask next would be if all problems can be tackled with reduction. Unfortunately, in practice, finding the right translation between a pair of problems (Step 1, above) can be prohibitively difficult. Reduction is easiest when the two problems seem to have an obvious relationship we can exploit, which brings us to the Molecube and the Rubik&amp;rsquo;s cube.&lt;/p&gt;
&lt;h2 id=&#34;a-sudoku-like-transformation&#34;&gt;A Sudoku-Like Transformation&lt;/h2&gt;
&lt;p&gt;It&amp;rsquo;s difficult to overstate how much of the Molecube&amp;rsquo;s solution is given away in its advertising as &amp;ldquo;Sudoku + Rubik&amp;rsquo;s cube&amp;rdquo;. My solution will treat this equation quite literally, starting with a transformation that relies on a Sudoku puzzle. I found this transformation by asking two simple questions:&lt;/p&gt;
&lt;img src=&#34;shuffled.png&#34; style=&#34;display: inline-block; width: 48%; margin-right: 2%&#34;/&gt;
&lt;img src=&#34;rubiks-cube.jpg&#34; style=&#34;display: inline-block; width: 46%; margin-left: 2%&#34;/&gt;
&lt;ol&gt;
&lt;li&gt;How are the Molecube and the Rubik&amp;rsquo;s cube similar?&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;They&amp;rsquo;re both 3x3x3 cubes, meaning they both have 6 faces, 8 corners, and 12 edges. This totals 26 balls (on the Molecube) or blocks (on the Rubik&amp;rsquo;s cube).&lt;/li&gt;
&lt;li&gt;Their physical mechanics (spinning, twisting, etc.) are identical.&lt;/li&gt;
&lt;li&gt;Their goals are, in a way, also identical: from a shuffled configuration, reach a goal configuration.&lt;/li&gt;
&lt;/ul&gt;
&lt;ol start=&#34;2&#34;&gt;
&lt;li&gt;How are the Molecube and the Rubik&amp;rsquo;s cube different?&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;Their goal configurations are different: the Molecube wants one ball of each color on each face, while the Rubik&amp;rsquo;s cube wants each face to be all the same color.&lt;/li&gt;
&lt;li&gt;There are nine colors on the Molecube, but only six on the Rubik&amp;rsquo;s cube.&lt;/li&gt;
&lt;li&gt;A block on the Rubik&amp;rsquo;s cube has 1–3 colors (one for each face it touches), while a ball on the Molecube is the same color on all &amp;ldquo;sides&amp;rdquo;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The similarities hint at a solution: though the goal configurations are different, the cubes&#39; structures and mechanics are the same. So if I find a goal configuration for the Molecube, I can use the Rubik&amp;rsquo;s cube algorithm to handle all the tricky rearranging involved in actually getting there.&lt;/p&gt;
&lt;p&gt;If that&amp;rsquo;s enough of a framework for you to attempt your own solution, feel free to download the &lt;a href=&#34;https://mhmmoshtaghi.github.io/files/molecube_worksheet.pdf&#34; target=&#34;_blank&#34;&gt;worksheet&lt;/a&gt; I&amp;rsquo;ve created to help you visualize the Molecube as a Sudoku puzzle (with colors instead of numbers). You&amp;rsquo;ll want to stop reading here and come back once you&amp;rsquo;ve completed a goal configuration or if you&amp;rsquo;re stuck and need hints.&lt;/p&gt;
&lt;p&gt;Speaking of hints, the best way to unlock this tricky Sudoku-like color puzzle (getting one color on each face) is to study the Molecube&amp;rsquo;s colors and structure. I asked myself the following questions (which culminated in the table at the top of the &lt;a href=&#34;https://mhmmoshtaghi.github.io/files/molecube_worksheet.pdf&#34; target=&#34;_blank&#34;&gt;worksheet&lt;/a&gt;):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How does the Molecube fit nine colors on a cube with 26 balls?&lt;/li&gt;
&lt;li&gt;How are the colors distributed over the different types of balls (centers, corners, and edges)?&lt;/li&gt;
&lt;li&gt;Are there any patterns that appear when trying to place balls of a certain color so it appears on each face exactly once?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The answers to these questions are revealing. There are three balls of each color, with the important exception of Green, which only has two. Further, Green is the unique color that is on two corners. Red and Purple are each on three edges, and the remaining six colors (White, Black, Orange, Yellow, Light Blue, and Blue) are each on one center, one corner, and one edge. This information — after some careful thinking — reveals the patterns we need:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;As in the Rubik&amp;rsquo;s cube, centers opposite one another are always opposite one another (i.e., Black is always opposite White, Orange is always opposite Yellow, and Blue is always opposite Light Blue).&lt;/li&gt;
&lt;li&gt;The only way the two Green corners avoid being on the same face is if they&amp;rsquo;re opposite one another (e.g., upper-right-back and lower-left-front).&lt;/li&gt;
&lt;li&gt;The only way the three Red (or Purple) edges avoid being on the same face is if a Red (or Purple) appears exactly once in each &amp;ldquo;middle band&amp;rdquo; (shown below, left). So each middle band contains exactly one Red and one Purple.&lt;/li&gt;
&lt;li&gt;For any of the remaining colors, (e.g., Blue) there is a center of that color. This blocks the corner of that color from being in the same &amp;ldquo;layer&amp;rdquo;, so the corner must go in the layer opposite the center (shown below, right). Once the position of the corner is fixed, there is only one position the edge of that color can go.&lt;/li&gt;
&lt;/ul&gt;
&lt;img src=&#34;rule1.png&#34; style=&#34;display: inline-block; width: 47%; margin-right: 2%&#34;/&gt;
&lt;img src=&#34;rule2.png&#34; style=&#34;display: inline-block; width: 47%; margin-left: 2%&#34;/&gt;
&lt;p&gt;Using these rules and some trial and error, I found the solution shown below, also detailed in the &lt;a href=&#34;https://mhmmoshtaghi.github.io/files/molecube_worksheet_solved.pdf&#34; target=&#34;_blank&#34;&gt;worksheet solution&lt;/a&gt;. (An interesting aside: I don&amp;rsquo;t know if this is the only solution, but any solution works for the reduction). To relate the Molecube solution to the Rubik&amp;rsquo;s cube solution, we simply treat each 3×3 face on the Molecube as a &amp;ldquo;color&amp;rdquo; on the Rubik&amp;rsquo;s cube. (For example, the Black ball at the top-left of the White-center face becomes the Red-White-Green block on the Rubik&amp;rsquo;s cube). This completes the transformation step of the reduction.&lt;/p&gt;
&lt;img src=&#34;sudoku-soln.jpg&#34; style=&#34;display: inline-block; width: 47%; margin-right: 2%&#34;/&gt;
&lt;img src=&#34;rubiks-mapping.jpg&#34; style=&#34;display: inline-block; width: 47%; margin-left: 2%&#34;/&gt;
&lt;h2 id=&#34;rubik-ing-the-molecube&#34;&gt;Rubik-ing the Molecube&lt;/h2&gt;
&lt;p&gt;With the difficult transformation step out of the way, the rest of the reduction is easy. You can solve any shuffled Molecube just like you would a Rubik&amp;rsquo;s cube (assuming you know how to do that), but instead of aiming to have faces with all the same color, you aim to build the goal configuration we got from the transformation (above, left). To make this easier for me to visualize, I made a 3D rendering of my solution (front view on the left, back view on the right).&lt;/p&gt;
&lt;img src=&#34;featured.png&#34; style=&#34;display: inline-block; width: 47%; margin-right: 2%&#34;/&gt;
&lt;img src=&#34;solved-back.png&#34; style=&#34;display: inline-block; width: 47%; margin-left: 2%&#34;/&gt;
&lt;p&gt;I was pleasantly surprised at how much Rubik&amp;rsquo;s cube muscle memory I still had from speedcubing in junior high (though if you need a refresher, I found &lt;a href=&#34;https://hobbylark.com/puzzles/Rubik-Cube-Algorithms&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;this tutorial&lt;/a&gt; helpful). Interestingly, some of the steps in the Rubik&amp;rsquo;s cube &amp;ldquo;algorithm&amp;rdquo; are unnecessary for the Molecube. Remember the earlier observation that the Molecube&amp;rsquo;s balls are each a single color while the Rubik&amp;rsquo;s cube blocks can have 1–3 colors each? This means that the Molecube doesn&amp;rsquo;t care if its balls are rotated &amp;ldquo;in place&amp;rdquo;, though this is a problem for the Rubik&amp;rsquo;s cube (see the example below). So any steps in the Rubik&amp;rsquo;s cube algorithm that are meant to fix things like this can be skipped entirely.&lt;/p&gt;














&lt;figure  &gt;
  &lt;div class=&#34;d-flex justify-content-center&#34;&gt;
    &lt;div class=&#34;w-100&#34; &gt;&lt;img src=&#34;https://usercontent2.hubstatic.com/14101285_f1024.jpg&#34; alt=&#34;&#34; loading=&#34;lazy&#34; data-zoomable width=&#34;90%&#34; /&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;/figure&gt;
&lt;h2 id=&#34;but-does-it-work&#34;&gt;But Does It Work?&lt;/h2&gt;
&lt;p&gt;To show that the reduction approach not only works but is also reasonably fast, here&amp;rsquo;s me solving the Molecube in just under 2 minutes.&lt;/p&gt;

&lt;div style=&#34;position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;&#34;&gt;
  &lt;iframe src=&#34;https://www.youtube.com/embed/QRtTLvtXWrQ&#34; style=&#34;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;&#34; allowfullscreen title=&#34;YouTube Video&#34;&gt;&lt;/iframe&gt;
&lt;/div&gt;

&lt;br/&gt;
&lt;p&gt;There are a &lt;em&gt;lot&lt;/em&gt; of Rubik&amp;rsquo;s cube-inspired puzzles these days (for example, the &lt;a href=&#34;http://www.recenttoys.com/meffert-ghost-cube-twister-puzzle/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Ghost Cube&lt;/a&gt; and the &lt;a href=&#34;http://www.recenttoys.com/meffert-pyraminx-twister-puzzle/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Pyraminx&lt;/a&gt;). But solving the Molecube by reduction makes me wonder just how many of these new puzzles share a similar relationship to the original Rubik&amp;rsquo;s cube. If these relationships exist, we&amp;rsquo;d find that these new puzzles aren&amp;rsquo;t really new at all; they&amp;rsquo;re just an old puzzle we know how to solve, but with new names and nice packaging.&lt;/p&gt;
</description>
    </item>

    <item>
      <title>The Three Academics: A Joke</title>
      <link>https://mhmmoshtaghi.github.io/post/the-three-academics/</link>
      <pubDate>Tue, 30 Jul 2019 09:15:00 -0700</pubDate>
      <guid>https://mhmmoshtaghi.github.io/post/the-three-academics/</guid>
      <description>&lt;p&gt;Mathematicians really care about correctness. We believe unspoken assumptions are dangerous. We think vague language is confusing, and saying more or less than we mean is grounds for misunderstanding. We want terms to be clearly defined, and for points to follow logically, like links in an unbreakable chain of truth. But sometimes people say things that are completely reasonable and yet we still feel the need to set them straight:&lt;/p&gt;














&lt;figure  &gt;
  &lt;div class=&#34;d-flex justify-content-center&#34;&gt;
    &lt;div class=&#34;w-100&#34; &gt;&lt;img alt=&#34;&#34; srcset=&#34;
               /post/the-three-academics/the-three-academics-lowres_huc2345e23d7c9b85a48da5ce8d8476a68_168428_4f17334aea9310bd9c7aa31446707618.png 400w,
               /post/the-three-academics/the-three-academics-lowres_huc2345e23d7c9b85a48da5ce8d8476a68_168428_141baf6ae9c3a125432b27dadfc380a3.png 760w,
               /post/the-three-academics/the-three-academics-lowres_huc2345e23d7c9b85a48da5ce8d8476a68_168428_1200x1200_fit_lanczos_3.png 1200w&#34;
               src=&#34;https://mhmmoshtaghi.github.io/post/the-three-academics/the-three-academics-lowres_huc2345e23d7c9b85a48da5ce8d8476a68_168428_4f17334aea9310bd9c7aa31446707618.png&#34;
               width=&#34;587&#34;
               height=&#34;760&#34;
               loading=&#34;lazy&#34; data-zoomable /&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;/figure&gt;
&lt;p&gt;This is my first contribution to the world of webcomics, a medium I&amp;rsquo;ve long admired for being able to deliver witty, weird reflections on life in simple packages. Giving credit where it&amp;rsquo;s due, this &amp;ldquo;joke&amp;rdquo; is adapted from &lt;a href=&#34;https://www.goodreads.com/book/show/1618.The_Curious_Incident_of_the_Dog_in_the_Night_Time&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;em&gt;The Curious Case of the Dog in the Night-Time&lt;/em&gt;&lt;/a&gt; by Mark Haddon and the art style takes after &lt;a href=&#34;https://www.instagram.com/poorlydrawnlines/?hl=en&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;poorlydrawnlines&lt;/a&gt; by Reza Farazmand. In living out &lt;a href=&#34;https://www.alabasterco.com/blogs/articles/all-that-is-made&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;generous making&lt;/a&gt;, this comic is available as a high resolution &lt;a href=&#34;https://mhmmoshtaghi.github.io/uploads/the-three-academics-highres.png&#34; target=&#34;_blank&#34;&gt;PNG&lt;/a&gt; or &lt;a href=&#34;https://mhmmoshtaghi.github.io/uploads/the-three-academics.pdf&#34; target=&#34;_blank&#34;&gt;PDF&lt;/a&gt; for you to use as you&amp;rsquo;d like. (Just keep my authorship in the corner intact, please!)&lt;/p&gt;
&lt;p&gt;And hey, to the economists out there: if you&amp;rsquo;ve got any good roasts of mathematicians, I&amp;rsquo;m all ears.&lt;/p&gt;
</description>
    </item>

  </channel>
</rss>
