Rendered at 05:25:48 GMT+0000 (Coordinated Universal Time) with Cloudflare Workers.
hahajk 4 hours ago [-]
i know everyone plays with their own rules, but from my perspective, a square root spends a 2 - it's not an operator like + or ! . there's an implicit "2" since you could also take the cube root or fourth root
jjmarr 1 hours ago [-]
You can use `sin(arctan())` as the repeatable operator instead of sqrt(). Then "unwrap" by applying ^-2 - (2^-2)
Squaring is to multiplication as is the latter to addition. If roots are invalid then so should be multiplications.
penteract 2 hours ago [-]
Exponentiation is to multiplication as multiplication is to addition. Squaring is to multiplication as doubling is to addition.
SamBam 2 hours ago [-]
GP didn't say roots are invalid, just that they burn a two.
If we agree that 2^2 uses two twos (and, indeed, that 2^3 isn't valid, because it uses a 3), then what's the equivalent of a square root?
Of course to my simple math brain, a square root is ^1/2, which includes the digit 1. But I agree there is someone 2-ish about the square root.
3 hours ago [-]
danparsonson 3 hours ago [-]
Would you elaborate on that? That doesn't make any sense to me
drfloyd51 2 hours ago [-]
Multiplication is repeated addition.
2x3= 2+2+2
AxB= A+A B times.
Raising to a power is repeated multiplication.
2^3= 2x2x2
A^B = AxA B times
Roots are the inverse of powers
Division is the inverse of multiplications.
Given this… the OC’s comment about giving exceptions to powers in the rules is nonsense because they are still operations.
mojomark 2 hours ago [-]
Multiplication is not the same as repeated addition, which you can observe as soon as you try the two different operations on fractions or negative numbers. For example, you can't add a number to itself 1/3 times, but you can certainly scale a number by 1/3.
Multiplication is a scaling operation.
goodmythical 21 minutes ago [-]
Can you not? 9+(9(1/3)) [adding nine to itself a third of a time] is nine plus one third of nine {or nine divided by three} which is one of the three in three times three that equals nine which is three therefore 9+(9(1/3))=11 because 9+3=11
spieglt 2 hours ago [-]
Multiplication is adding numbers to themselves. Exponentiation is multiplying numbers by themselves. Ditto division/taking roots. Squaring a number is just the instance of exponentiation that happens to have two operands. If taking a square root is an inherent use of a two, then dividing a number by another number should also be a use of a two, because there are two operands.
jibalt 1 hours ago [-]
Because it's just wrong. hahajk said that taking the 2nd root spends a 2, not that "roots are invalid". (FWIW, I'm not necessarily endorsing the view that the square root symbol implicitly spends a 2, I'm just saying that the counterarguments given are logically wrong ... actually more like semantically wrong.)
The comment below by drfloyd51 is similarly wrong ... hahajk didn't say anything about "giving exceptions to powers in the rules".
And the comment by speglt is also wrong:
> If taking a square root is an inherent use of a two, then dividing a number by another number should also be a use of a two, because there are two operands.
The number of operands isn't relevant; the degree of the root is.
And from SideQuark we get
> One could even claim division is raising to the -1 power, thereby disqualifying it in exactly the same manner you disqualify sqrt.
But hahajk said nothing about anything being disqualified. (Not to mention that division is not raising to the -1 power ... raising what? n/d = n * d^-1, but this is completely irrelevant to hahajk's argument.)
SideQuark 3 hours ago [-]
Alternatively, one can claim sqrt is a single symbol, and there are extensions requiring a digit. Log, ln, also have hidden bases, but they’re also valid symbols. Cos/sin may be in radians or degrees, both in common use, and no real place to denote it.
One could even claim division is raising to the -1 power, thereby disqualifying it in exactly the same manner you disqualify sqrt. I’ve never seen sqrt with a 2 index; power -1 is seen quite often for division.
Go figure….
adas0693 6 hours ago [-]
there is a related problem (inspired by an interview questions from ITA software, a part of Google now) that asks to find the smallest positive integer that cannot be expressed using a digit K (in [2,9]) N times in an expression that involves the four basic arithmetic operations and the parentheses: +, -, *, /, (, and ).
to make the problem more interesting, the list of operations can be extended to include exponentiation and concatenation.
for example, using the four basic operations for N=4, and K in [2,9], we get:
7 cannot be computed in 4 2s;
11 cannot be computed in 4 3s;
10 cannot be computed in 4 4s;
8 cannot be computed in 4 5s;
9 cannot be computed in 4 6s;
4 cannot be computed in 4 7s;
5 cannot be computed in 4 8s;
4 cannot be computed in 4 9s;
catlifeonmars 4 hours ago [-]
This feels very suspiciously like a finite field problem.
genter 5 hours ago [-]
Are you allowed to brute force it?
dooglius 27 minutes ago [-]
Figuring that out is presumably part of the interview (and would depend on N)
argee 4 hours ago [-]
That's how you do it right? It's a BFS with 4 being the max depth, and you print whatever numbers in the problem set which you didn't find.
3=(sin(arctan(sin(arctan(sin(arctan(2))))))^−2 − (2)^−2
Squaring is to multiplication as is the latter to addition. If roots are invalid then so should be multiplications.
If we agree that 2^2 uses two twos (and, indeed, that 2^3 isn't valid, because it uses a 3), then what's the equivalent of a square root?
Of course to my simple math brain, a square root is ^1/2, which includes the digit 1. But I agree there is someone 2-ish about the square root.
2x3= 2+2+2 AxB= A+A B times.
Raising to a power is repeated multiplication.
2^3= 2x2x2 A^B = AxA B times
Roots are the inverse of powers
Division is the inverse of multiplications.
Given this… the OC’s comment about giving exceptions to powers in the rules is nonsense because they are still operations.
Multiplication is a scaling operation.
The comment below by drfloyd51 is similarly wrong ... hahajk didn't say anything about "giving exceptions to powers in the rules".
And the comment by speglt is also wrong:
> If taking a square root is an inherent use of a two, then dividing a number by another number should also be a use of a two, because there are two operands.
The number of operands isn't relevant; the degree of the root is.
And from SideQuark we get
> One could even claim division is raising to the -1 power, thereby disqualifying it in exactly the same manner you disqualify sqrt.
But hahajk said nothing about anything being disqualified. (Not to mention that division is not raising to the -1 power ... raising what? n/d = n * d^-1, but this is completely irrelevant to hahajk's argument.)
One could even claim division is raising to the -1 power, thereby disqualifying it in exactly the same manner you disqualify sqrt. I’ve never seen sqrt with a 2 index; power -1 is seen quite often for division.
Go figure….
to make the problem more interesting, the list of operations can be extended to include exponentiation and concatenation.
for example, using the four basic operations for N=4, and K in [2,9], we get:
7 cannot be computed in 4 2s; 11 cannot be computed in 4 3s; 10 cannot be computed in 4 4s; 8 cannot be computed in 4 5s; 9 cannot be computed in 4 6s; 4 cannot be computed in 4 7s; 5 cannot be computed in 4 8s; 4 cannot be computed in 4 9s;
And JFYI since December is near: https://rant.gulbrandsen.priv.no/hack/advent-calendar-for-ne...
7 = ⌈ 2.2² + 2 ⌉