Quick off-topic note: Ever since Niantic doubled the range for gyms in Pokémon Go, I can now reach the gym in the alley while sitting on my couch. Game. Changer. It turns out that playing Pokémon Go while sitting on your couch gets pretty boring after a while.
But enough of that, let me tell you about three small pieces of software that do not get enough love. They are the parser, the previewer, and the auto-tipper. They weren't very high on the priority list before, but now that a LOT of developer time is being put into providing educational resources to help students learn math while schools are closed, these have moved even further down the list.
The parser takes the answer that a student submits (either for Alcumus or a Challenge Problem) and compares it to the right answer that our team has provided. The parser tries really hard to decide if the quantities really are the same and whether the student's submission really is in the form that the problem requested. The parser is just a piece of software, though, and not a human, and it is not able to do all of the various algebraic manipulations that a human can do in order to see that two quantities are equal. The parser tries really hard, though. When the team checks on the health of the server, it's pretty clear that the parser is doing
a lot of work.
Fun fact! The parser is written in Python. It might be the only part of the AoPS site that is written in Python. Nobody is sure why it is written in Python. Some people say it is because the previous version of the parser was written in Python. Other people say that this is not true and that the previous version of the parser was written in Lisp. Nobody really knows.
The previewer tries to take what a student has submitted and display it in LaTeX to help students determine if what they are saying is what they really meant. The previewer and the parser do not always agree. In fact, the previewer and the parser have very different opinions about what the submissions in calculus classes mean, so the previewer has been turned off in calculus classes. Because it lies. Lies! Yes, we should fix it.
Yes, there are a lot of things that should be fixed. Yes, other things keep moving ahead of this one. For example, physics classes need answers typed in different ways from math classes. Math classes hate it when you type units with your answers; physics classes require it. Math classes insist on exact answers; physics classes want numbers approximated to a particular number of decimal places. So in order to get basic stuff working at all for physics classes, we have to move it ahead of some of the math stuff that is only somewhat broken.
But let me tell you about the auto-tipper! Just like how there is an auto-tagger in the community that suggests tags for your posts, there is an auto-tipper in the homework system so that we don't need to specify all the formatting tips by hand for all of the problems.
There is a quote attributed to Jamie Zawinski that says:
Quote:
Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.
The auto-tipper uses regular expressions (you may also hear them referred to as "regexes"). You might not know what regular expressions are. They are a form of black magic that we use to tell a computer to match a particular pattern of text. For example,
[ab]\d.\d
would match anything that starts with the character
a or
b, then has a digit, then has any character, then has any digit. So it would match to
a2(3 but not to
c2(3. It would match
a989 but not
a98g.
Are you bored? Need more things to keep you busy? You should learn more about regular expressions! You can practice using regular expressions and test them out at the site
http://regex101.com.
Let me tell you why: The auto-tipper for cube roots and other non-square roots has a small mistake in it. While fixing all of the other broken software is going to take people working full-time for a significant amount of time, fixing this mistake in the auto-tipper involves writing a new regular expression (something that
you could do) and then putting it in the place where it belongs.
So here is my task for you: Write a regex that matches algebraic expressions that include roots other than square roots. When we're writing the answers to problems, we use fractional exponents in order to denote roots other than square roots. So your regex should match an algebraic expression that contains fractional exponents (so that the auto-tipper will suggest the cube roots and other non-square roots tip) and should
not match algebraic expressions that do not contain fractional exponents. That is, your regex should match something like

(which we should type as 2^(1/3) in the homework system) or
, typed as (x^2 + 6)^(3/5), but it should not match something like
, which would be typed as (x^2 + 6)^3/(5x). Added wrinkle: I think that some of the problem-writers use LaTeX for writing the answers. But for now, let's stick to plain text.
This is Round 1 of the BugMaster regex challenge. In Round 2 we'll see if we also need to match LaTeX in order to make this work. Once we have a winner (or winners) and an excellent regex that always suggests the cube roots and other non-square roots tip at the right time and never at the wrong time, I will try to sneak the winner's (or winners') name(s) (by which I mean username(s)) into a word problem in the course of their choice. Do note that this is
not a promise, especially as there is a daily email that rats out all changes to homework problems.
Submit your regexes in the comments! Peer review the other submissions and let the author know if you've found mistakes: Are there situations with fractional exponents that get missed? Situations without fractional exponents that get matched by mistake?