This abstraction is very cool and allows us to prove facts that would not be provable if we thought that sets could include stuff that were not sets and therefore could not be broken down further.
Here’s a nice example:
I was asked to prove both of the following statements in Naive Set Theory
\[X=\bigcup \mathcal{P}(X) ; \\ X \subset \mathcal{P}\left (\bigcup X \right ).\]When I try to prove something, especially in set theory, I try to visualize it in my head to make an intuitive proof and then write the mathematical proof after. I was able to easily visualize the first statement. Since the power set is just all of the subsets of a set, surely unioning all of the subsets of a set would give the set itself.
The second one was much more confusing and I couldn’t visualize it. It’s basically saying, take a set, union all its elements together, then take the power set of that, and the original set will be a subset of that power set. I got lost at union all of its elements together. How does this work? For example, how do we do \(\bigcup \{ 1, 5, 113, 55 \}\) ? The elements are just numbers, not sets! … Oh wait, the beginning of the book said that in set theory all we have are sets. So they are actually sets!
For each item in \(X\), there are two possibilities of what it could be.
1) It could either be the empty set (\(\varnothing\)), or a set with items in it (literally everything else including numbers, ordered pairs, functions, etc). If it is the empty set, no elements will be added to the union, but the empty set is always an element of any power set, because it is a subset of all sets. So that element of \(X\) is taken care of.
2) For the rest of the elements of \(X\) that were not the empty set, their underlying elements will get merged together in \(\bigcup X\). For example, let’s say \(X = \{ \varnothing, \{a,b \}, \{ c\} \}\). Then \(\bigcup X = \{a,b,c\}\). The key thing is that taking the power set of this will create all the sets that were originally in \(X\), and more. \(\mathcal{P} \left ( \bigcup X \right ) = \{\varnothing, \{a\}, \{b\}, \{c\}, \{a,b\}, \{a,c\},\{b,c\}, \{a,b,c\}\}\). This contains all of the sets that were originally in \(X\) plus a few more. Once we have the everything is a set mindset, then it becomes visually intuitive why \(X \subset \mathcal{P} \left ( \bigcup X\right )\): we are re-building all of the sets that made up \(X\), and more. A simple change of perspective turned an unintuitive problem into an intuitive one! I love this.
Why am I writing about this?
When I find a cool idea that challenges my previous thinking, I like to blog about it so that I can think even more clearly about it. I also like to do it because I think more people should know that everything is a set!
]]>In a survey, more than a quarter of students said that they are taking at least one class that they would not have taken if not for some outside pressure. The majority of students also said that the main pressure driving them to take classes that they did not want to take was the thought of college. Just ask any high schooler and they will tell you that college is always in the back of their mind whenever they make a decision.
A 2020 study of a Catholic high school found that “[a]n overwhelming majority (90.4%) of students identified school and academic pressures as one of their main stressors,” with a “high degree of student ownership in choosing to participate in advanced/honors classes” (Uitermarkt 25). One student even said grades are “life or death … Grades determine future” (26). Clearly, when given the option, students will choose to take Honors and AP classes, even at the expense of their own mental health and stress levels. Why is this?
If schools offer harder classes, students will take them to look competitive. Colleges like to see that students took harder, more rigorous classes. The problem is that the students will take these classes, even if they don’t find them intrinsically interesting. There is a negative feedback loop of a hard class getting introduced, students taking it to look competitive, then other students taking it because they don’t want to be perceived as less competitive than the first students, and then the cycle repeats. This feedback loop only ends because there’s a limit to how many advanced classes it is physically possible to take (due to scheduling issues for example).
Some students get really close. Just go onto the College Confidential forum (a website filled with students asking what they should do to get into “good” colleges) and you’ll see students asking if seven APs is too much. They justify it by saying that “I want to move up to at least position #2 of my class, and it should be possible if I pass all my 7 AP classes next year” (studentstudent265). It’s quite clear that in this case, and lots more, the student does not care about learning the content in the class at all; they just want to look good for college. You can find (less extreme) versions of this problem anywhere in the education system you look.
In fact, this issue is so common that it’s named an ‘Inadequate Equilibria’ by decision theorist Eliezer Yudkowsky. It describes a situation where everyone suffers due to prevailing conditions, yet individual actions alone cannot alter the status quo. (Yudkowsky 32). If one student just decided to not take any AP classes, they would be worse off because other students would have better-looking transcripts. Even if many students tried to coordinate to not take as many AP classes as possible, one student could just break the equilibria and choose to take advanced classes, thus putting themself ahead of everyone else. To fully break out of an Inadequate Equilibria, there must be some sort of unanimous coordination to shift to a new one. In this case, some sort of outside institution that would not allow students to take advanced classes could work. A school perfectly encompasses this definition.
Coincidentally, [redacted place name] High School already does a form of this: students are not allowed to take AP classes until Junior Year. When I first heard of it, this seemed like a silly rule to me. I thought that the school was stunting my intellectual progress for no good reason. Yet after learning about Inadequate Equilibria, I suddenly realized its wisdom. If everyone were able to take AP classes in 9th grade, as some schools allow, there would be a race to the bottom, and everyone would stress themselves out trying to take as many AP classes as possible. But since the school limits this, students have less stress.
An even more extreme example of this restriction on honors classes recently occurred in California for a slightly different reason. The state wanted to prevent students from being able to take Algebra I in 8th grade, which would subsequently prevent them from taking Calculus during high school (CA Dept of Education). In [redacted place name], we call this track “Single Accelerated” and allow any student who passes a test in 7th grade to take Algebra I in 8th grade instead of 9th. The CA Dept of Education’s justification for removing it was to increase equity and level the playing field, but it was going to inadvertently have the effect of holding capable students back. The policy only got canceled after prominent mathematicians and computer scientists, totaling 1786 people including seven Nobel laureates, created a petition arguing to allow students on an accelerated track. They argued that “[w]hile it is possible to succeed in STEM at college without taking advanced courses in high school, it is more challenging … Far from being deliberately held back, all students should have the opportunity to be nurtured and challenged to fulfill their potential” (Barak et al.). So this camp clearly takes the view that students should be allowed to accelerate or take honors classes if they are up to it.
Coming back to [redacted place name], we have a microcosm of this debate with honors classes and double-acceleration. Students are allowed to take a test at the end of 6th grade (although this is not very well-known) to place into taking Algebra I in 7th grade, which is known as double acceleration and allows students to skip two years of math instruction. For honors classes, although teachers recommend at year-end whether students should enroll in honors classes, the final decision rests with the students and their parents, which is exactly the kind of solution that Barak et al. want. While it gives students more freedom, some teachers think this choice is ultimately unnecessary and, in many cases, harmful. I asked Ms. [redacted], our Geometry Honors and Algebra II Honors teacher for her thoughts on this the issue. She mainly criticized the practice of overriding teacher recommendation in the context of our policy of open enrollment: “we have a lot of students that ignore the teacher’s recommendation and sign up for courses that they’re not recommended for. And we are finding that there’s a really big problem with people enrolled in honors and having trouble.” But besides the students just struggling in a class that is too hard for them, it also creates issues for students in non-honors classes. Since many students drop honors classes once they realize the classes are too hard, it means that they must go into the non-honors sections, which makes the “honors [sections] teeny tiny … there should have only been two [but there were three].” Once students leave the honors classes, they overload the regular sections which makes them much bigger and harder to teach, increasing the burden on the teacher while also making it harder for an individual student to learn than if the classes were correctly allocated.
When asked how this sort of behavior has changed over the years, she said that “it’s a lot worse now than it used to be.” What has mainly changed is that it is much harder to get into college nowadays due to more people applying and policies such as yield protection and active waitlists; thus everyone is much more competitive (Papallo-Wall). Ms. [redacted] knows that “there’s a college for you. It’s not like, you’re not going to get into college. Are you going to get into Harvard? No, but you’re probably not going to get into Harvard anyway.” According to her, the pressure to look good for college has created this meaningless race to the bottom, and the solution is to have less students take honors classes while still leaving the option open for the students who can handle it.
Some people oppose efforts to remove honors classes, make them recommendation only, or keep them open but allow less privileged students to struggle. They think that with the right strategies, an open enrollment policy can work, and all students can learn in honors. In an article titled “Effective Teaching Strategies for Open Enrollment Honors and AP Classes,” Susan Winebrenner, a long time consultant on the topic of teaching gifted kids, acknowledges that open enrollment is motivated by a want to “empower students from minority groups and students of poverty to have access to courses that often lead to higher success rates in college,” the exact reasoning that Barak et al. use to argue for allowing acceleration in California. She then argues that there is a third alternative to removing or limiting honors classes to capable students who have already shown competence in a subject. With accommodations for global learners, students “who learn best from the whole back to the parts and respond favorably to the use of visual organizers and hands-on learning experiences,” honors classes can maintain their “high standards and academic rigor” (159). She proposes teaching strategies that are concrete methods for increasing engagement and understanding with these different types of learners.
According to Winebrenner, the most effective method is called the “Name Card Method.” It involves asking a question, having students discuss the answer, and then calling on a student randomly from a stack of name cards. The randomness of the name cards removes any racial, economic, gender, or other bias that the teacher may have, which equalizes the learning experience for students who might come from underrepresented groups. In fact, our own Spanish teacher, Señor [redacted], uses this technique in his Spanish Honors classes to a great extent. Every class, we discuss in Spanish with our partners and then share (by random choice of name) what we talked about. Besides being fun, it ensures that everyone is participating and that no one is falling behind.
This practice of making honors classes more accessible to everyone might make them slightly easier and would definitely allow more students do well, but it would not eliminate the Inadequate Equilibria that causes students to overwhelm themselves by taking as many honors classes as possible. If we look deeper, we can decompose the problem with honors into two distinct problems: the problem with the difficulty of classes — what Ms. [redacted] describes as many students failing and having to drop, but also the pressure to take honors classes. Clearly, they are connected, and it seems that there is a causal relationship where the pressure to take honors classes leads to students not doing well in those classes. From this perspective, the techniques Winebrenner suggests would only fix the first problem — difficulty of honors classes for diverse learners — not the problem of pressure to take the classes in the first place. To combat this, we should propose a solution similar to the one [redacted place name] already has for AP classes (none until 11th grade) to limit the number of honors classes a student can take.
If this seems too restricting, schools should consider explicitly telling students not to take as many honors classes as possible. This is especially important because right now, they tell students to take honors classes to get into a good college. According to Ms. [redacted], “[students are] told by guidance counselors that like, they should take honors classes for college.” In fact, my guidance counselor told me that taking a class I didn’t want to take would look better for college, and it was very hard to resist that pressure, especially since she also told my parents. Even as simple a change of instructing guidance counselors not to say this could help.
With all the different perspectives on regulating advanced classes, we need to remember that unlike college acceptances or rankings, learning is not a zero-sum game. If one student learns more, that does not mean that another must learn less to balance out. Learning is a positive-sum game where teachers, if they believe in it, can bring everyone who wants to learn to a level where they are satisfied with their own learning. Honors classes do not have to be something that only a select group of students who have proved themselves can be in (contra Ms. [redacted]’s perspective). Nor do should we accept that the only way to make learning equitable is to remove honors classes altogether (the California perspective). We can keep honors classes without throwing students from less privileged backgrounds in the deep end by using teaching strategies that accommodate a more diverse set of students. Yet we should still encourage students to not take as many honors classes as possible to prevent the race to nowhere — enforcing this with rules if necessary.
Instead of encouraging students to drop a class when it becomes challenging, as I’ve seen many honors teachers do, teachers should be encouraging and use the strategies that Winebrenner proposes to help struggling students. If we reject the false dichotomy that honors classes are stressful but necessary and non-honors are the opposite and instead focus on every student learning what they need to know in a lower pressure environment, we will end up with outcomes that take the best parts from all proposed solutions.
Eventually, I realized that my confusion boiled down to the fact that I didn’t really have any experience with the multivariate Taylor series, but it is actually not necessary.
I present another simple way to derive the above formula without really doing the Taylor series (it is exactly equivalent though):
\[\frac{\partial L}{\partial e_\text{clean}} \approx \frac{\Delta L}{\Delta e} = \frac{L_\text{corr} - L_\text{clean}}{e_\text{corr} - e_\text{clean}}.\]Solving for \(\Delta L\), we get
\[\Delta L = \frac{\partial L}{\partial e_\text{clean}} * (e_\text{corr} - e_\text{clean})\]by multiplying the \(e_\text{corr} - e_\text{clean}\) over.
This gives \(\Delta L\) with shape of the activations, with the biggest components having the biggest sway in the circuit. To turn it back into a scalar for the metric, we can just reduce sum over it, or equivalently compute it using the dot product instead of elementwise product, which is what the paper did.
I hope that this post illuminated the method better, especially if you don’t have a math background.
]]>Note: This post is aimed at someone who already knows what evidential decision theory and Newcomb’s problem are. If you don’t, consider learning about them. They are quite interesting.
Evidential decision theory was used way earlier than I would have expected, and its development was motivated theologically.
Unconditional election is the Protestant (mainly Calvinist and Puritan) idea that God made the decisions of who would go to heaven and hell before He created the world (very similar to predestination). It is “unconditional” because nothing you do in your life can change the outcome of whether you go to heaven or hell.
If you believe in this unconditional election, then you face a dilemma: “if election is unconditional and grace is irresistible, then why not sit back and wait for the inevitable?” (Stearns and Brawner, 30). If this is the case, where did the term “Puritan work ethic” come from? Why were the Sepratists so religious? According to Stearns and Brawner, prayer was used to find out if you were “elected”:
The simplest and perhaps most satisfying method of dealing with this question was that of examining closely personal experience for signs of election. If an anxious Christian could find assurance that the seeds of regeneration had been planted in him, he could then be urged to labor with the Holy Ghost to bring forth the fruits of sanctification and thus participate actively in the work of his own redemption. But the spiritual physicians could not administer real comfort unless they could demonstrate convincingly that the symptoms of true faith and repentance were distinguishable from the simulacra produced by hope and fear. To this end they labored diligently. In 1592, William Perkins published a work entitled, A Case of Conscience, the greatest that ever was: How a Man may know whether he be a Child of God or No. The years that followed witnessed a great volume of sermons and treatises addressed in whole or in part to the same question. This literature may properly be called scientific, in the modern sense of the word, because it proceeded from the premise that the human will is a passive agent of the Holy Ghost—just as in modern psychology, the will is a passive agent of equally mysterious pneuma, labelled id, libido, etc. Puritan casuistry, in other words, was a branch of the science of pneumatology. It was not primarily concerned to chasten hypocrites (for hypocrites and true believers alike were caught up in the same inexorable determinism), but to identify the phenomena of rebirth, and to separate these from what today we would call auto-suggestion and wish-fulfillment. These phenomena were sorted out and arranged in normative, episodic sequences with which individual Puritans could compare their own experiences. In addition, rules of thumb were worked out by which the authenticity of individual experience could be tested.
These norms and rules of thumb—which Morgan sums up as the “morphology of conversion”—were applied to Bay Colony Congregationalist standards of admission in the form of the church relation.” By listening to a brief account of a candidate’s spiritual experience, and by occasionally asking well-chosen leading questions, expert examinersinitially the church elders—could quickly decide, on grounds well-laid, whether the candidate was, in Perkins’s words, “a child of God or no.” Thus, the church relation was a seventeenth century forerunner of the Rorschach, or ink-blot, test, by which a trained technician can make a sketchy but comprehensive assessment of the salient features of his subject’s personality. (Stearns and Brawner, n.d., 30-31).
Taking the idea further, the Puritans wanted evidence that they were elected (Heyrman n.d.). And since humans essentially have free will (even if we don’t actually), we can create evidence. The Puritan work ethic comes from the idea that “the Puritan sought success as evidence of his election to eternal bliss” (Griswold 1934, 476). The Puritans were allowed to work hard (and charge interest on loans) because God allowed them. If they were sucessful, surely they were “elected,” and if they were not elected, God would make them unsucessful. Put another way, being sucessful was evidence that they were “elected,” so they should strive to be sucessful.
This logic is isomorphic to Newcomb’s Problem. The money (or heaven) is already in the box. Omega (or God) can not change the outcome. You can gain more utility by opening both boxes (or “sitting back and waiting for the inevitable”). You can choose to make the decision that someone who Omega thought would one-box would make (or the choices that God knew you would make if you were “elected”).
We can use this as a case study to see what happens when someone actually believes an exotic decision-theoretic paradox deep in their bones. They one-box.
There are a few reasons this might not be that good of a case study. First, in the case of the Puritans, does two-boxing (living a life of laziness) actually provide more utility? The Puritans seemed to think being lazy and unpious provided them with more immediate-term utility, but to me, it’s unclear. Second, most people were not thinking for themselves; they were following the preists and theologans. Finally, the theology evolved and most Christians today do not believe in unconditional election.
When I made the connection between the Puritans and evidential decision theory, I was really surprised. Investigating it more, it feels slightly more natural. Of course, it’s still quite impressive and is a testament to how much intellectual progress can be made under totally false assumptions.
My answer was “The speed of sound decreases because heating up a gas decreases its density. Lower density means lower speed of sound because the particles have to travel further to bump into other particles.” I got 1/2 points on this question because although I got the incorrect answer, my justification was “correct”.
When I got the test back and saw what I got wrong and how I had gotten it wrong, I realized that my mental process went wrong. I was equally able to explain the truth as the opposite of the truth, and this is bad. I want to find the truth.
The reason that my teacher gave was that if a gas was hotter, the molecules moved faster, and thus bumped into each other faster and the speed of sound was faster.
This explanation is not that convincing to me, so I’m going to do an analysis of what went wrong in my thought process and how I can prevent it in the future.
So it seems the main thing that I missed was the extra factor of pressure, in addition to density. In the future, I should try to include all of the factors in a problem and give equal weight to the true or false answers. I’ll admit thought that this might be hard to prevent in the general case since it didn’t seem to be a meta-level confusion – just an object level one.
If you have a better explanation for this, please feel free to email me at jacoblevgw at gmail dot com and I’ll put it here.
]]>[Epistemic Status: I wrote this for English Class. I think the ideas are mostly true.]
As I’m starting my senior year of high school and sending off my college applications, I’ve been thinking a lot about how grades change our relationship to our work. While it may seem that grades just evaluate the outcomes of our writing, the grade we get can actually influence our writing and shape it in ways that are incredibly hard to avoid. They subtly change what we write about, but also the style in which we write and prevent us from improving.
Before we talk about their effects, let’s take a look at their uses: how and why are they used in schools? They are convenient: a grade essentially converts a multifaceted paper into a single number that tells how a student did overall. All teachers have to do is read the paper, do some thinking, and then come up with a number. Colleges use them to decide how good of a student you are. All jokes aside, we’re stuck with grades for the time being, so let’s investigate what effect they have on our writing.
When I get an essay back, the first thing I do is look at the number at the end and judge how well I did on it from the grade, not the comments. I’m being irrational here since the comments contain much more information than the grades. They span multiple parts of the rubric and are personalized to my relationship with the teacher. Yet I still look at the grade first and judge myself on it because it’s what I’m conditioned to do, and for some stupid reason, I just care a lot about the number.
Grades also play a part in masking deeper issues in writing with surface level ones. In the “standard” style of five paragraph essays that we all learned in middle school, it’s easier for teachers to focus on – and grade – the structure more heavily than creative ideas. While you might think that some students do need this scaffolding, it actually seems that the ideas, not the style, are more important to develop. In his article “Inventing the University,” Bartholomae observes that “The stages of development that I’ve suggested are not necessarily marked by corresponding levels in the type or frequency of error, at least not by the type or frequency of sentence level errors” (17). A grade easily encapsulates the stylistic and sentence level issues with an essay, yet those errors are the least important. The deeper issues with the creative ideas are much more important, but are harder to correct with a grade than the stylistic issues and show up mostly in the comments (which I’m guessing that most students, like me, should but don’t pay much attention to). Of course, I’m sure some teachers use grades to correct creative ideas, but I suspect, given Bartholomae’s analysis, that most use grades for structure and mechanics, especially since these kinds of writing conventions are more objective and less subject to dispute.
Further, grades change our style and diminish creativity. I’ve been lucky to take honors English classes for the past two years, which means that I’ve had a lot more freedom in my writing. But for many students (past me included), the thought of “I should do this for a grade” sucks all the voice out of writing. We don’t write how we speak but instead how we are taught to write. Bartholomae gives an almost comical exaggerated example of this: “Creativity is the venture of the mind at work with the mechanics relay to the limbs from the cranium, which stores and triggers this action” (5). In most cases, the influence is more mild than in this example, but grades give teachers power over our writing, which can be used for good but is more often than not used to entrench focus on structure rather than creative ideas.
I’m reminded of a similar story that June Jordan told in her article “Nobody Mean More to Me Than You And the Future Life of Willie Jordan.” She was teaching a class about Black English when the brother of one of her students died of police brutality. The class wanted to make a public statement, but they had a choice to make: “Should the opening, group paragraph be written in Black English or Standard English?” (Jordan 371). They really struggled because they knew that choosing Black English would mean that the letter would be dismissed, but more meaningful to them, while one using Standard English might get published but would be using the “language of the killer” (Jordan 372). They chose Black English and didn’t get published. Similarly, when writing for a grade, we often (but shouldn’t) have to choose between writing in a way that we like and writing in a way that will get us a good grade.
In fact, there are even a few changes I’m making to this essay because I’m writing it for a grade. If I were writing just for my blog, I would tell parables and force the reader to make connections between them and my ideas (as I did in this post), but that is just so far from what we do in English class that I fear a lower grade.
Speaking of my blog, I recently rediscovered how much fun writing for oneself can be. Since joining the rationality community and seeing people write about what interests them, I’ve written a few posts about programming and philosophy and posted them to various aggregators. Although I didn’t get a grade, I got something even better – lots of people with more experience than me commenting on my writing. Some agreed wholeheartedly, while some partly agreed; others fully disagreed and thought my ideas were wrong. I don’t gain sentence-level feedback from this process – but as Bartholomae said, that’s not really as important as feedback on the ideas. The lack of a grade allows me to focus fully on the creative idea-level feedback and develop better ideas next time.
The sentence “All people are equal.” (and ones like it) seems simple at first glance but actually contains a lot of depth. Depending on how you interpret it, it can be false or subjective, but I don’t think it’s true.
The most naive interpretation is obviously false. All people are literally not equal in the physical sense. Our atoms are in different configurations. Neither are we equal in the psychological sense. We react to the same stimuli in different ways.
So what in the world do people mean when they say all people are equal?
Do they mean everyone has equal rights? That makes a little more sense, but it is not true. I do not have the same rights as someone living in Switzerland or China.
Hmm, maybe they mean that everyone has equal opportunities? A quick thought falsifies this interpretation. So what do they mean?
What someone really means when they say “All people are equal.” is “I wish for all people to be equal!” which is neither true nor false. It is a wish about the future. I do wish for all people to be equal (but not in the Harrison Bergeron sense, more along the lines of equal rights).
The reason we knee-jerk react to “All people are equal.” is because our culture has conditioned us, from the humanism of the Enlightenment to the Declaration of Independence and onwards, to believe it is true. We don’t realize that we are really stating a wish when we think we are making a true statement, and this is dangerous.
Conversely, there are some statements that look like opinions (or maybe even falsehoods) at first glance, but are actually true. (Statements about intelligence fit this category very nicely, but I’m going to leave them out.) These statements usually go against what culture has conditioned us to believe. For example: “All people are not equal.” This statement is true but is usually interpreted as “I wish for all people to have unequal rights.” (a wish), but it should just be interpreted as a fact. Again, this is dangerous, since it masks what is really true.
In order to push society forward – to actually make everyone equal and become better – we need to separate our beliefs and wishes. If we believe that something that is not true (but that we want to be true) is actually true, we won’t notice it as much and will not spend as much time and effort on fixing it. If, however, we could accurately believe the (sometimes inconvenient) truth, we could reduce the time until our wishes become the truth.
Now go fix the world!
]]>At the Recurse Center Feb 2020: I watch a talk during presentations about someone optimizing a database engine. It was really complicated, and I remeber nothing about the talk itself. What I do remember is thinking to myself “this seems really complicated for no good reason.” Keep in mind, I had never made a web application at that time and when I needed to store data, I just used a csv file or a python pickle file on the disk. I thought that a filesystem was sufficient for storing data.
Fast forward a few months and I’m building my first web application. I don’t remember what it was for, but I remember using a csv file as the database. I had to load the file into memory every time I wanted to look something up and it was just a big pain. I now understood why using a database is (sometimes) a good idea.
Learning Rust, July 2020: I start learning about the borrow checker. It prevents you from keeping a pointer to an item of a vector (&vec[i]
) if you pass the Vec<T>
as a &mut
. I don’t really get why this is necessary. I have never done low-level programming before, never used pointers, and now I am being told that following the borrow checker is ‘safe’. It is still very confusing to me.
Fast forward to when I am writing Zig code. I take &array_list.items[i]
, append to the array_list
and then try to write to the stored pointer. I get a segfault. Ahh, now I get the problem Rust solves.
Learning Vue, July 2020: Why are there all of these complicated ways to represent state? Shouldn’t developing a web app be simpler than this?
After writing a bunch of vanilla JS, I can see why these frameworks could be useful. I have never made a very big web app, but I could see that keeping track of state and what is or isn’t rendered is hard and gets much harder with a bigger web app.
To fully understand a “best practice” or why something is necessary, it’s important to experience how things go wrong without it. When teaching programming, we should let people make these mistakes, and then show them the tools to correct them. Just giving someone a complicated tool without a salient reason to explain its complexity will just make them really confused.
Some opinions:
javac
from the command line before using an IDEHave you had an experience like this? Email me at jacoblevgw at gmail and I’ll put it below.
Examples from readers:
Arian Araf: You should learn Assembly before you learn optimization
Almoctar Hassoumi: Use HTML before using a CMS like WordPress
See more on HN
]]>Ever since learning more about history in the past year or two, I’ve started having a really weird sensory experience. I can see history. What I mean by this is that when I hear a date when something happened, I can place it in my field of view. The timeline also has different levels of zoom on a sort of logarithmic scale.
I think this experience/model all started when I learned the US Presidents using Anki. For every president, I learned the years they served, their picture (picture → name), and the party they belonged to. I did this not because I’m some crazy history buff, but just because I wanted to test how well Anki works. I found that Anki works remarkably well. I was able to memorize all the presidents and becuase of the nature of the spaced-repititon algorithm, still remember most (>95%) today.
As a side effect of memorizing all the presidents, I developed this weird timeline sense. I (semi-)concously tried to place the presidents in the timeline when remembering them. I think that visualizing this timeline in my head every day cemented it. I started to place other dates and historical facts that I learned on the same timeline. It became a self-organizing way to dump all my historical knowlege.
Here’s how it works for me: When thinking in the context of the 20th and 21st centuries, which are the 2 most common centuries for me to think about, the 20th century starts at the left of my field of view. Maybe at 70° W (if N is straight ahead). The turn of the 21st century is at around 20° E. But I can also zoom in or out. For example, when I zoom in on my timeline to just the 21st century, I see the year 2000 at the left of my field of vision and 2023 at the far right. I can also zoom out from 0 AD to today, with similar locations. What I can’t do, and I find this pretty interesting, is zoom in on the 5th century. Like sure, I can just pretend to visualize a timline of it in my head, but it does not feel the same as visualizing latter centuries. I think the reason for this is because I don’t know many events that can ground the timeline in the 5th century. I know many more events that are in the latter centuries, so that could be a possible reason why I can visualize their timeline in more detail.
I wonder how much of this sense I should attribute to Anki. Anki has clearly both provided facts to populate the timeline and also a motivation for my brain to form this timeline. In fact, I’ve been thinking about the idea that intelligence is just knowlege compression. I’m pretty sure that one of the reasons that my brain created the timeline was to make it easier to memorize the dates that I was learning. Learning the presidents in order is actually the perfect application of a timeline. Every point on the timeline is filled in, for the most part, the years of service follow a simple pattern (4 or 8 years), and I linearly added to the end of the timeline starting from 1789. This year in school I took AP US History, where I learned a LOT more dates with Anki (I made at least one flashcard for everything my teacher said (I have 1586 cards tagged apush
or history
)). And sure enough, I placed these on the timeline as well. My brain found a really good way to compress temporal, factual, knowlege (which humans aren’t that good at remembering), with visual knowlege (which humans are really good at dealing with).
[This is where the epistemic status applies the most, I don’t know if anything I’m saying here is true.]
AI is not just metaphorically trying to compress knowlege; LLMs are literally trained to compress the entire internet into their weights. Given that Gradient Descent is probably better than the process my brain used to make my timeline, I suspect that in a multimodal model, if any mode is slightly more effective at storing knowlege than other modes (like vision is for humans) a lot of knowlege that is not even in that format will be stored and accessed in that format because it is more efficient for the model to learn it in that format. Furthermore, we could validate this by doing mechanistic interpritability reserach. If see that a model is using the same algorithms to access two totally different formats of data, it would be evidence for this hypothesis. I don’t really know much about multi-modal models or how they work, but I’m assuming that they are the next logical step from LLMs, so this hypothesis could be testable soon.
If you have this same sense or something similar to it, please email me (jacoblevgw at gmail). I’m really curious how this manifests in others. Humans have really diverse patterns of thought.
]]>A few people have approached me to ask how to get better at programming computers, so I thought I would write something that could help the most people – a blog post.
I’ll start with the journey that I took, and then give some distilled advice.
By the time I started coding seriously in eighth grade, I had always been familiar with code. I had done some coding camps where I copied boilerplate Java and Swift code and then changed it a bit. I knew what an if statement was, what a loop was, etc… But I never coded much at home. I hadn’t grasped the essence of what it means to program a computer. When I tried, I would get stuck on something and then give up on coding. I’ll assume you’re starting close to here. If you are more advanced than I was when I started – awesome!
In eighth grade, we had tech class where the project was to create a game in Scratch. Scratch is a really good program, and if you are using it, that’s great! However, I tried to code my game in Scratch, but got really frustrated with how limiting the blocks were. I thought that if I used something else to code it, it would be easier. Starting a pattern where I say “how hard could it be,” (and then it turns out to be hard) I started using my Mom’s old Thinkpad x220 to code in pygame. This undoubtedly took much more time than just doing the equivalent in scratch, but I learned python, so that’s a plus. (If you want to see the (really bad) code, here it is.)
I also was simultaneously learning calculus just for fun3. I have some really cringey memories of doing Khan Academy during art class free draw. Thankfully, my art teacher was chill and didn’t mind. This allowed me to kind of understand how neural networks worked (not that well, but the important thing was that I felt that I understood how neural networks worked and I believed that it wasn’t hard to learn.) I had lots of fun watching 3Blue1Brown’s series on neural networks and reading an excellent book on the topic. So I said “how hard could it be” again and tried to implement my own neural network (by liberally copying from the book) that could kind of guess if you drew a smiley or frowney face. I then implemented the neural network in JavaScript, put it on the web, called it a science fair project.
In February 2020, I applied to the Recurse Center, “The retreat where curious programmers recharge and grow,” and got in! I spent a week there and met some amazing people who helped me learn to program. I learned about functional programming and big O notation.
A month later, the pandemic (Covid-19) hit. School went from taking up most of my time to basically non-existent. I had so much more time to spend programming. I installed Linux on an old laptop laying around. I programmed a simple video editor, made another platformer game in the Rust Programming Language, some web scrapers, failed on a bunch of projects (self-driving car simulator, text editor, …, autoencoder for smiley faces), started watching Luke Smith on YouTube (I don’t particularly recommend this). I learned \(\LaTeX\) (a scientific typesetting program) and way over-engineered my To Kill A Mockingbird final essay – that never got graded – with \(\LaTeX\). I just had a glut of time and soaked up knowledge. I probably didn’t learn nearly as efficiently as I could have, but I still learned.
I’ve also made some web-apps that utterly failed. One was an outright copy of another web-app. Another one was a to-do app with a novel feature – it scheduled your time for you. Both got no users (I didn’t even use them) and I gave up on them. But both of these gave me really valuable web development knowledge, so I don’t regret making them at all.
At the end of the summer of 2020, I was on vacation in Maine with my family. I brought my kindle with me and used its web browser to read programming blogs. Then, I suddenly had an urge to learn about compilers (the program that turns human code into something that a machine can understand). I downloaded compiler books onto my kindle from my Mom’s computer, and started to read as much as I could. I got really excited and called up my High School’s computer science teacher to ask him if I could do an independent study with him about writing a compiler when I entered high school in a month, and he said yes. I made my own programming language called ez. Ez was my biggest project so far and I learned so much writing a compiler! (I later independent-studied AP Computer Science A with the same teacher in freshman year. If you want to do it, and already know how to code, it’s pretty easy. I recommend just buying a Barron’s review book, reading it, and doing all the practice tests.)
To learn how to write ez, I read the source code of the Zig compiler and then got involved in the development of Zig’s compiler. I learned so much contributing to a real-world, big, open-source project. Contributing to Zig took up a substantial amount of my time in the 2020-2021 school year. Getting involved in the open-source community was one of the best things I could have done. I chatted with real adults on IRC who didn’t know my age and took me seriously as another adult. I matured both in personality and in technical knowledge. I understand the fear that there are dangerous strangers on the internet, but in my opinion, as long as you know what to look out for, talking with people on the internet is a really good way to learn programming. People will take you more seriously if you show them that you have something to contribute to their project, so try to fix some bugs.
I then got really interested in the Plan9 operating system and installed it on an old Thinkpad that I had lying around my house. I had the amazing idea to try combine my interests and get Zig running on Plan9. I had to reverse engineer Plan9’s binary format and write an extension to the Zig compiler that allowed it to output Plan9 binaries. I did this (it’s still not fully complete – I plan to finish it this summer) and then gave a talk about it.
Since then, I have been doing physics-informed neural networks research, learning about spaced repetition memory systems, and learning about rationality.
PROGRAM A LOT – This is the only way to get better.2
This advice has worked for me, and I’m not sure how well it will work for others. Feel free to pick and choose what you take.
If you want to learn calculus, which I highly recommend (high school calculus becomes really easy, you can learn neural networks, and its really fun), first use 3Blue1Brown’s excellent calculus playlist and then do Khan Academy for practice. As long as you are motivated, I’d say only algebra is the prerequisite. There is no speed limit. ↩