Barcodes Here is an example of a UPCA barcode, taken from wikipedia: A UPCA barcode has 12 digits. The first digit is something that tells how the numbers are generally used – for example, a particular industry might use a certain number for certain kinds of items. The last twelfth digit is a check digit that can try to tell whether or not the numbers have an error. This check digit is constructed in a certain way at first. Later on, the check digit may be able to tell us if the numbers have an error or not. The check digit is constructed as follows: We have 11 digits:…


Sets and Borel Sigma Algebra
Showing \begin{equation} \label{eq:0.99=1} \tag{1} \large \bf 0.\bar{9} = 1 \end{equation} kjh \begin{equation} \label{eq:0.99=io1} \tag{1} 0.\bar{9} = 1 \end{equation} klh

Portfolio Insurance and Black Monday, October 19, 1987
On the thirtieth anniversary of Black Monday, the stock market crash of October 19th and 20th in 1987, there have been mentions of “portfolio insurance” having possibly exacerbated the crash. Portfolio insurance, in principle, is exactly what you might expect it to be: if you own a stock, Stock A, you insure it with a put option on Stock A. Your position becomes equivalent to a call option on Stock A until the put option expires, with the price of this position being the premium of the put option when you bought it. If you are managing a portfolio on behalf of clients, though, and you just need to…

Valueadded Tax and Sales Tax
(This is mostly a summary of and heavily borrowed from https://en.wikipedia.org/wiki/Valueadded_tax, archived). (The first three figures are taken from Wikipedia). Comparing No Tax, Sales Tax, and VAT Imagine three companies in a value chain that produces and then sells a widget to a consumer. The raw materials producer sells raw materials to the manufacturer for $1.00, earning a gross margin (revenue – Cost Of Goods Sold, COGS) of $1.00. The manufacturer sells its product, the widget, to the retailer for $1.20, earning a gross margin of $0.20. The retailer sells the widget to a nonbusiness consumer (for the customer to use and consume) for $1.50, earning a gross margin…

Testing MathJaxLaTeX
beforemathjax textbefore https://math.meta.stackexchange.com/questions/5020/mathjaxbasictutorialandquickreference Default font size. Different font size. Bold text. bold text. italic text. Italic text. Underlined text. At first, we sample $$f(x)$$ in the \(N\) ($N$ is odd) equidistant points around \(x^*\): \[ f_k = f(x_k),\: x_k = x^*+kh,\: k=\frac{N1}{2},\dots,\frac{N1}{2} \] where \(h\) is some step. Then we interpolate points \((x_k,f_k)\) by polynomial \begin{equation} \label{eq:poly} \tag{1} P_{N1}(x)=\sum_{j=0}^{N1}{a_jx^j} \end{equation} Its coefficients \(a_j\) are found as a solution of system of linear equations: \begin{equation} \label{eq:sys} \tag{asdf} \left\{ P_{N1}(x_k) = f_k\right\},\quad k=\frac{N1}{2},\dots,\frac{N1}{2} \end{equation} \begin{equation} \label{eq:sys2} \tag{asdf2} \{ P_{N1}(x_k) = f_k\},\quad k=\frac{N1}{2},\dots,\frac{N1}{2} \end{equation} Backslash left and right parentheses: \[ \left( \frac{1}{2} \right) \qquad ( \frac{1}{2} ) \\ ( \frac{1}{2} ) \] $$…

The Curiously Inscrutable Principles of Trade Mechanics of Europa Universalis 4 (aka another EU4 trade guide)
Prologue My goal here is to explain from first principles the fundamentals of trade mechanics in EU4. This will not attempt to be a comprehensive guide on all aspects of trade, but it does attempt to be a comprehensive guide and tutorial on the mechanics of trade nodes and merchants. I will try to explain the system from the ground up as well as communicate an intuitive understanding and interpretation. I will attempt to be rigorous with the mechanics but will be more brushstrokey with tactics, strategy, and modifiers (since modifiers just complicate things and in application are a part of strategy). My hope is to explain the basics…

Cyberpunk Images: Japan and China
IMHO, Japan is “fantasized cyberpunk.” People (especially in the west) look at the night lights of Japanese cities and it makes them fantasize about cyberpunk, conjuring images from Neuromancer, Blade Runner, various anime, and the Matrix (the green Japaneselooking code on the screens). China is real “high techlow life” cyberpunk, because there’s actual low life in the midst of development and high tech, and it’s an actual dystopia. Like, that last part isn’t an exaggeration – it actually is a dystopia. It is utopian in its amazing, unprecedented growth out of poverty since 1979, but dystopian in its government, economic inequality, and environmental issues. Japan on the other hand is…

Brainteaser: The Monty Hall Problem
You are on a game show and presented with 3 doors. Behind one is a car and behind the other 2 are goats. You want to choose the door with a car behind it, as if you do so, you win the car. You choose one door. Then, the host opens one of the other doors, which reveals a goat behind it. The host gives you a choice to either switch your door to the other one that’s still closed or keep your original choice. Should you switch doors? Answer: If your strategy is to stick to your original choice, your probability of choosing the door with the…

Brainteaser: 100 Prisoners in a Line and Extension
There are 100 prisoners. An executioner tells them that tomorrow morning, he will line them up so that each of them is facing the back of the head of another prisoner, except for one prisoner at the end of the line. In other words, prisoner 1 sees the back of the head of prisoner 2 as well as the backs of the heads of prisoners 3100, prisoner 2 sees the back of the heads of prisoners 3100, …, prisoner 99 only sees the back of the head of prisoner 100, and prisoner 100 doesn’t see any prisoners in front of him. The executioner tells them that he will put either…

Brainteaser: Blue Foreheads
100 people are in a room. All 100 of them are perfect logicians. They are told that at least one person in the room has blue paint on their forehead. They are told that once you deduce that you have blue paint on your forehead, the next time that the lights are turned off, leave the room. All 100 people have actually had their foreheads painted blue (but of course, each of them don’t know this at this point – they can only see the other people’s foreheads). The light is turned off, then on, then off, on, etc. What happens? Answer: So each person sees…