r/EncapsulatedLanguage • u/AceGravity12 Committee Member • Jul 28 '20
Basic arthimatic through basic algebra
NOTE: <add>, <multiply>, <power>, and <?> are placeholders that will be replaced when an official phonotactic system is chosen.
Math System:
Taught by example version:
What is “1 1 ? <add>”? It's “2”. (1 + 1 = 2)
What is "2 1 ? <add>”? It's “3”. (2 + 1 = 3)
What is "1 2 ? <add>”? It's “3”. (1 + 2 = 3)
What is "2 ? 1 <add>”? It's “-1”. (2 + X = 1, X = -1)
What is "3 ? 1 <add>”? It's “-2”. (3 + X = 1, X = -2)
What is "3 ? 2 <add>”? It's “-1”. (3 + X = 2, X = -1)
What is "? 1 1 <add>”? It's “0”. (X + 1 = 1, X = 0)
What is "? 2 1 <add>”? It's “-1”. (X + 2 = 1, X = -1)
What is "? 1 2 <add>”? It's “1”. (X + 1 = 2, X = 1)
Is "1 1 1 <add>” true? No. (1 + 1 ≠ 1)
Is "1 2 3 <add>” true? Yes. (1 + 2 = 3)
What is “ 1 1 ? <multiply>”? It's “1”. (1 × 1 = 1)
What is "2 1 ? <multiply>”? It's “2”. (2 × 1 = 2)
What is "1 2 ? <multiply>”? It's “2”. (1 × 2 = 2)
What is "2 ? 1 <multiply>”? It's “1/2”. (2 × X = 1, X = 1/2)
What is "3 ? 1 <multiply>”? It's “1/3”. (3 × X = 1, X = 1/3)
What is "3 ? 2 <multiply>”? It's “2/3”. (3 × X = 2, X = 2/3)
What is "? 1 1 <multiply>”? It's “1”. (X × 1 = 1, X = 1)
What is "? 2 1 <multiply>”? It's “1/2”. (X × 2 = 1, X = 1/2)
What is "? 1 2 <multiply>”? It's “1”. (X × 1 = 2, X = 2)
Is "1 1 1 <multiply>” true? Yes. (1 × 1 = 1)
Is "1 2 3 <multiply>” true? No. (1 × 2 ≠ 3)
What is "1 1 ? <power>”? It's “1”. (1 ^ 1 = 1)
What is "2 1 ? <power>”? It's “2”. (2 ^ 1 = 2)
What is "1 2 ? <power>”? It's “1”. (1 ^ 2 = 1)
What is "2 ? 4 <power>”? It's “2”. (2 ^ X = 4, X = 2)
What is "3 ? 1 <power>”? It's “0”. (3 ^ X = 1, X = 0)
What is "3 ? 2 <power>”? It's “log3(2)”. (3 ^ X = 2, X = log3(2) ≈ 0.631)
What is "? 1 1 <power>”? It's “1”. (X ^ 1 = 1, X = 1)
What is "? 2 1 <power>”? It's “1 and -1”. (X ^ 2 = 1, X = 1, -1)
What is "? 1 2 <power>”? It's “2”. (X ^ 1 = 2, X = 2)
Is "1 11 1 <power>” true? Yes. (1 ^ 11 = 1)
Is "2 2 5 <power>” true? No. (2 ^ 2 ≠ 5)
Now for some hard ones:
What is “1 2 ? 3 <add> ? <add>”? It's “2”. (2 + X = 3, X = 1, => 1 + X =2)
Is “1 1 ? <power> 1 ? <multiply> 1 2 <add>” true? Yes. (1 ^ 1 = X, X = 1 => 1 × X = Y, Y=1 => 1 + Y = 2 )
Nitty-gritty version:
This system uses reverse polish notation and a number question word to construct arithmetic from 4 words. Because of this, parentheses are never needed. Three of the words are ternary relations:
“<add>” states that its first two arguments added together equals the third. “<Multiply>” states that its first two arguments multiplied together equals the third. “<power>” states that its first argument to the power of its second argument equals the third. The final word “<?>” asks you to take the trianary relation and figure out what number “<?>” has to be to make it true (all “<?>”s in a single relationship are the same so “<?> <?> 2 <add>” is 1, “<?>” is technically purely formatting not a variable, that system will come later). Whenever one of these three words has “<?>” in it the entire relation can be treated as a single number for grammatical purposes, if it has no “<?>”s in it then it can be treated as either True or False. Because of this, relations are able to nest inside of each other allowing for more complicated numbers to be represented. IMPORTANT NOTE: This is the backbone of a full mathematical system, while it can express everything needed to teach basic algebra, that does not mean more features cannot be added in the future to make things more convenient. Big thanks to Omcxjo, who kept me on track preventing feature creep, helped clean up the system, and pointed out many errors.
Edit: formatting
View all comments
Show parent comment
1
u/Haven_Stranger Jul 29 '20 edited Jul 29 '20
Yep, that is what an identity is. The two thing set equal are always equal, no matter the values of the coefficients and variables. And one of the points of having an algebraic identity is substitution. We can replace Ax * Ay with Ax+y (and vice versa) as part of the process for, say, solving for A or solving for x or whatever we're doing with an equation to make it suit some purpose.
Another sort of thing we'll want is the point-slope form for the equation of a line, which is different than the standard form. Someone will have to find what posfix representation lets you easily plug in a point's coordinates and a slope, and then just do math.
A lot of algebra boils down to solving for one unknown in terms of some other unknowns. There has to be a clear representation of "when you fill in the rest and do the math, this is what you've solved for". There has to be an easy way substitute one term or member for another. I'm sure that those are implicit in the system, requiring mere discovery rather than invention. It is, after all, just math.
Infix algebra has some unary operations. Postfix binary operations might suit the same purpose here: say, negative A as ( A ? - ). We can even call that a shortcut or abbreviation for ( A ? 0 + ), if you like. In infix, unary minus and binary minus don't need separate symbols. This postfix needs separate symbols, because one means "use the top three stack items" and the other "use the top two". Then again, this postfix won't need ternary subtraction because ternary addition covers that operation -- we're directly representing the additive inverse by leaving the agent empty and using the additive identity constant as our result.
Zero is the additive identity constant because you can add it to anything and not change the thing's value. The multiplicative identity constant is 1, by the same reasoning. So, the additive inverse of A must be ( A ? 0 + ) and the multiplicative inverse must be ( A ? 1 * ).
Yes, the ? is nothing like a variable. It's much more like "the empty marker" or some interrogative pronoun.
Binary operators might lead to a natural solution for representing inequality. Certainly, they'll make things like factorial possible. Factorial is a shortcut to express something else, but I don't have a good way to explain (well, to develop notation for) what the longer and more fundamental version of factorial is. Binary infix operation seems useful in its own right. ( 4 24 ! ). Therefore ( 4 ? ! ) and ( ? 24 ! ) are reasonable questions.
From there, you can get to absolute value, because that's also an infix unary. Hmm, it might be a postfix unary as well. I can't see how to make sense of reversing it. That is, I can't answer the question "what number did I start with if the absolute value is this?" At least, not the same way as "what number did I start with if the factorial is 24?"
The absolute value of negative eight is eight. ( |-8| = 8 ). Negative eight divided by the absolute value of negative eight is negative one, ( -8 / |-8| = -1 ), which represents just the negative sign of negative eight.
I think, from here, someone could derive an explicit "=" (if anyone cares) as well as > < ≥ ≤. This gives us a method for extracting the sign (negative, zero, positive) of a number, and the sign of a difference is the same as the result of a comparison. You could build up a long version of asking "is this less than, equal to, or greater than" in the algebra, and then afterwards (if it looks useful) find the best way to represent the shortcut operation.
I think there's something to the idea that the way the expression ends represents what the expression means. I think that, from that, some useful intuiting rule-of-thumb for "is this an identity" should emerge. Two operations at the end of the expression seems at least suggestive.
For Discord, I'd need time that I don't have. Let a later day bring whatever it brings.
Dude, your proposed backbone can carry a lot of semantic weight. I never would have expected postfix algebra to turn into grammatical theta. Color me impressed.