diff options
Diffstat (limited to 'blog')
-rw-r--r-- | blog/cognition.org | 41 | ||||
-rw-r--r-- | blog/img/coglogo.png | bin | 0 -> 28228 bytes | |||
-rw-r--r-- | blog/ltximg/org-ltximg_01dc37ba9cb224fc1886e1715ba5f33de9b7f603.png | bin | 0 -> 1153 bytes | |||
-rw-r--r-- | blog/ltximg/org-ltximg_2338f8065c912f0a4b08f98a341f34f4f939b215.png | bin | 0 -> 236 bytes | |||
-rw-r--r-- | blog/ltximg/org-ltximg_27b41ada4696293a6bd443c0a30fdc16190f62dd.png | bin | 0 -> 496 bytes | |||
-rw-r--r-- | blog/ltximg/org-ltximg_469970f5e27ef5fb41f5e5ddd73a4c22779636c5.png | bin | 0 -> 781 bytes | |||
-rw-r--r-- | blog/ltximg/org-ltximg_b2fb642980fc48ddee06a936c0c589a0a7e7d28d.png | bin | 0 -> 752 bytes | |||
-rw-r--r-- | blog/ltximg/org-ltximg_ca69a7a62a6c2964d5c3f60e541d65013a3993bf.png | bin | 0 -> 244 bytes | |||
-rw-r--r-- | blog/ltximg/org-ltximg_d94302badc90e0e1a1f129fc8a2742326d5a1753.png | bin | 0 -> 234 bytes | |||
-rw-r--r-- | blog/ltximg/org-ltximg_eb8ac71900afa4ed5497de468503d3ee67396901.png | bin | 0 -> 276 bytes | |||
-rw-r--r-- | blog/voting.org | 38 |
11 files changed, 63 insertions, 16 deletions
diff --git a/blog/cognition.org b/blog/cognition.org index f331ba0..01dbcfb 100644 --- a/blog/cognition.org +++ b/blog/cognition.org @@ -12,16 +12,6 @@ #+html_head: <meta name="viewport" content="width=1000; user-scalable=0;" /> #+language: en #+OPTIONS: broken-links:t - -* Introduction -Cognition is an active research project that Matthew Hinton and I have been working on for the past -couple of months. Although my commit history for [[https://github.com/metacrank/cognition][this project]] has not been impressive, we came up with -a lot of the theory together, working alongside each other in order to achieve one of the most generalized -systems of syntax we know of. Let's take a look at the conceptual reason why cognition needs to exist, as -well as some /baremetal cognition/ code (you'll see what I mean by this later). There's a paper about this language -available about the language in the repository, for those interested. Understanding cognition might require a -lot of background in parsing, tokenization, and syntax, but I've done my best to write this in a very understandable way. -The repository is available at https://github.com/metacrank/cognition, for your information. * The problem Lisp programmers claim that their system of s-expression code in addition to its featureful macro system makes it a metaprogrammable and generalized system. This is of course true, but there's something very broken with lisp: metaprogramming @@ -45,6 +35,18 @@ but it is not /runtime dynamic/. It still utilizes preprocessing. So, what's the percise solution to this connundrum? Well, it's beautiful; but it requires some /cognition/. +* Introduction +Cognition is an active research project that Matthew Hinton and I have been working on for the past +couple of months. Although my commit history for [[https://github.com/metacrank/cognition][this project]] has not been impressive, we came up with +a lot of the theory together, working alongside each other in order to achieve one of the most generalized +systems of syntax we know of. Let's take a look at the conceptual reason why cognition needs to exist, as +well as some /baremetal cognition/ code (you'll see what I mean by this later). There's a paper about this language +available about the language in the repository, for those interested. Understanding cognition might require a +lot of background in parsing, tokenization, and syntax, but I've done my best to write this in a very understandable way. +The repository is available at https://github.com/metacrank/cognition, for your information. + +#+CAPTION: The Cognition programming language, logo designed by Matthew Hinton +[[file:img/coglogo.png]] * Baremetal Cognition Baremetal cognition has a couple of perculiar attributes, and it is remarkably like the /Brainfuck/ programming language. But unlike its look-alike, it has the ability to do some /serious metaprogramming/. Let's take a look at what the @@ -55,7 +57,8 @@ df dfiff1 crank f #+end_example -And *do* note the whitespace (line 2 has a whitespace after df, and the newlines matter). Erm, okay. What? +And *do* note the whitespace (line 2 has a whitespace after df, line 3 has a whitespace, and the newlines matter). +Erm, okay. What? So, our goal in this post is to get from a syntax that looks like /that/ to a syntax that looks like [[file:stem.org][Stem]]. But how on earth does this piece of code even work? Well, we have to introduce two new ideas: delimiters, and ignores. @@ -255,9 +258,9 @@ per token, where lower metacranks get priority. This means that if you set two d can execute per token tokenized, and the lower metacrank gets priority. Note that metacrank and, by extension, crank, don't /just/ depend on tokenized words; they also work while evaluating word definitions recursively, meaning if a word is evaluated in ~2 crank~, one out of two words will execute in each level of the evaluation tree. You can play around -with this in the repl to get a sense of how it works: run ~../crank bootstrap.cog repl.cog devel.cog load~, and use stem -like syntax in order to define a function. Then, run that function in ~2 crank~. You will see how the evaluation tree -respects cranking in the same way that the program file itself does. +with this in the repl to get a sense of how it works: run ~../crank bootstrap.cog repl.cog devel.cog load~ +in the coglib folder, and use stem like syntax in order to define a function. Then, run that function in ~2 crank~. +You will see how the evaluation tree respects cranking in the same way that the program file itself does. Metacrank allows for not only metaprogramming in the form of code building, but also direct syntax manipulation (i.e. /I want to execute this token once I have read n other token(s)/). The advantages to @@ -332,7 +335,13 @@ With the information above, one can work out the specifics of how it works; the that it does by going into the ~coglib~ folder and running ~../crank bootstrap.cog repl.cog devel.cog load~, which will load the REPL and load ~devel.cog~, which will in turn load ~comment.cog~. ** The Great Escape -Here we define a preliminary prefix escape character: +Here, we accelerate our way out of this primitive syntax, and it all starts with the great escape character. We make +many great leaps in this section that aren't entirely explained for the sake of brevity, but you are free to play around +with all of these things by using the repl. In any case, I hope you will enjoy this great leap in syntax technology; by +the end, we will have reached something with real /structure/. + +Here we define a preliminary prefix escape character. Also you will notice that ~2crank ing 0 crank~ is used as +padding between lines: #+begin_example 2crank ing 2 crank comment.cog load 2crank ing 0 crank @@ -579,4 +588,4 @@ You can imagine cognition can program basically any syntax you would want, and i of the already existing code that makes cognition work. In short, the system allows for true /syntax as code/, as my friend Andrei put it; one can /dynamically program/ and even /automate/ the production of syntax. In this article, we didn't have the space to cover other important Cognition concepts like the /Metastack/ and words like ~cd~, but this -can be done in a part 2 of this blog post. +can be done in a part 2 of this blog post. For now, let's leave off here, and we can meet here once more for a /part two/. diff --git a/blog/img/coglogo.png b/blog/img/coglogo.png Binary files differnew file mode 100644 index 0000000..44f9270 --- /dev/null +++ b/blog/img/coglogo.png diff --git a/blog/ltximg/org-ltximg_01dc37ba9cb224fc1886e1715ba5f33de9b7f603.png b/blog/ltximg/org-ltximg_01dc37ba9cb224fc1886e1715ba5f33de9b7f603.png Binary files differnew file mode 100644 index 0000000..b74e101 --- /dev/null +++ b/blog/ltximg/org-ltximg_01dc37ba9cb224fc1886e1715ba5f33de9b7f603.png diff --git a/blog/ltximg/org-ltximg_2338f8065c912f0a4b08f98a341f34f4f939b215.png b/blog/ltximg/org-ltximg_2338f8065c912f0a4b08f98a341f34f4f939b215.png Binary files differnew file mode 100644 index 0000000..479f396 --- /dev/null +++ b/blog/ltximg/org-ltximg_2338f8065c912f0a4b08f98a341f34f4f939b215.png diff --git a/blog/ltximg/org-ltximg_27b41ada4696293a6bd443c0a30fdc16190f62dd.png b/blog/ltximg/org-ltximg_27b41ada4696293a6bd443c0a30fdc16190f62dd.png Binary files differnew file mode 100644 index 0000000..5b72b73 --- /dev/null +++ b/blog/ltximg/org-ltximg_27b41ada4696293a6bd443c0a30fdc16190f62dd.png diff --git a/blog/ltximg/org-ltximg_469970f5e27ef5fb41f5e5ddd73a4c22779636c5.png b/blog/ltximg/org-ltximg_469970f5e27ef5fb41f5e5ddd73a4c22779636c5.png Binary files differnew file mode 100644 index 0000000..3db4c01 --- /dev/null +++ b/blog/ltximg/org-ltximg_469970f5e27ef5fb41f5e5ddd73a4c22779636c5.png diff --git a/blog/ltximg/org-ltximg_b2fb642980fc48ddee06a936c0c589a0a7e7d28d.png b/blog/ltximg/org-ltximg_b2fb642980fc48ddee06a936c0c589a0a7e7d28d.png Binary files differnew file mode 100644 index 0000000..f781457 --- /dev/null +++ b/blog/ltximg/org-ltximg_b2fb642980fc48ddee06a936c0c589a0a7e7d28d.png diff --git a/blog/ltximg/org-ltximg_ca69a7a62a6c2964d5c3f60e541d65013a3993bf.png b/blog/ltximg/org-ltximg_ca69a7a62a6c2964d5c3f60e541d65013a3993bf.png Binary files differnew file mode 100644 index 0000000..64464f9 --- /dev/null +++ b/blog/ltximg/org-ltximg_ca69a7a62a6c2964d5c3f60e541d65013a3993bf.png diff --git a/blog/ltximg/org-ltximg_d94302badc90e0e1a1f129fc8a2742326d5a1753.png b/blog/ltximg/org-ltximg_d94302badc90e0e1a1f129fc8a2742326d5a1753.png Binary files differnew file mode 100644 index 0000000..b03d945 --- /dev/null +++ b/blog/ltximg/org-ltximg_d94302badc90e0e1a1f129fc8a2742326d5a1753.png diff --git a/blog/ltximg/org-ltximg_eb8ac71900afa4ed5497de468503d3ee67396901.png b/blog/ltximg/org-ltximg_eb8ac71900afa4ed5497de468503d3ee67396901.png Binary files differnew file mode 100644 index 0000000..854d021 --- /dev/null +++ b/blog/ltximg/org-ltximg_eb8ac71900afa4ed5497de468503d3ee67396901.png diff --git a/blog/voting.org b/blog/voting.org new file mode 100644 index 0000000..eff2ec0 --- /dev/null +++ b/blog/voting.org @@ -0,0 +1,38 @@ +#+title: Representative Voting +#+author: Preston Pan +#+description: What do we do about voter turnout? Voting demographics? Polarization? +#+html_head: <link rel="stylesheet" type="text/css" href="../style.css" /> +#+html_head: <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"> +#+html_head: <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"> +#+html_head: <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"> +#+html_head: <link rel="manifest" href="/site.webmanifest"> +#+html_head: <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5"> +#+html_head: <meta name="msapplication-TileColor" content="#da532c"> +#+html_head: <meta name="theme-color" content="#ffffff"> +#+html_head: <meta name="viewport" content="width=1000; user-scalable=0;" /> +#+language: en +#+OPTIONS: broken-links:t +* Introduction +Current voting systems are broken, and people argue about ways to solve it. Many talk about about ranked-choice +voting or other ballot-systems, but I argue that the real problem in voting has to do with game theory principles. +In this article I endorse a system that has been tried out before, but has been forgotten: /random representation/. I +argue that it has game theoretic foundations that make it superior to other kinds of voting systems. + +** The Model +Let us assume that there is a small probability that you can swing the election $$ \rho $$, and a cost to voting; that +is to say, it takes some amount of time, which has opportunity cost associated with it to vote, which we +will call $$ \alpha $$. Let us assume that there is a high /reward/ in swinging the vote; that is to say, if you were +the one that swings the vote, your vote is worth some high monetary value. Let $$ \beta $$ be the median price of swinging. +Let $$ n $$ be the number of people voting, and let the weight of each vote be equal between all participants. +Let the choice of candidate between all voters be binary; voting for one candidate mutually excludes you from +voting for another, and there are two candidates (this is to simply the model; you will see that this does not +lose generality). Then, let us model the expected value of voting for singular individuals. + +For a given person, the probability that your vote swings (or at least ties) depends on the probability that +$$ x = \frac{n - 1}{2} $$, where $ x $$ is the number of people that vote for your candidate. The probability +density function for the probability that $$ m $$ people vote for your candidate we'll call $$ f $$. We will assume +it is binomial, and you might expect it to be closer to 50/50 most of the time, but that is pretty hard to model. +We will therefore compensate by modeling it more accurately afterwards. For now, we assume all participants have +a 50% chance to pick either candidate. +\begin{align*} +\end{align*} |