# Department of Science, Math, & Technology

E = mcÂ˛
Defeating Amber
Posted: Posted October 18th, 2017 by Kohlrak
 I hope i made this simple enough that I don't have to backtrack and re-define everything because i left something out or something like that. So if there are any questions, feel free to ask. Amber is a smart little girl, but she needs your help. She wants to know if you can confuse her, and make her mess up at her own game. See, Amber is trying to figure out how to math well, but she is incapable of dealing with anything other than whole numbers. Some of what she does can't handle negative numbers, but for some other things she's quite capable. Do you have what it takes to beat Amber at her own game? Rules: 1. All numbers must be whole: if there is a decimal at any point in the calculation, it gets "truncated" or "rounded down." 2. All challenges must be left oriented, meaning that you can only use expressions that must be evaluated. 3. Only one expression per challenge, but many challenges per post. 4. You must post the correct answer to the challenge. 5. No variables. Valid Arithmetic Operators: 5 * 5 / 5 % (division remainder) 6 + 6 - Valid bitwise operators (for programmers): ~ (not) 7 { (rotate left) 7 } (rotate right) 7 << (shift left) 7 >> (shift right) 10 & (and) 11 ^ (eXclusive OR) 12 | (or) Valid logical operators (0 for false, non-zero for true): 8 < 8 > 8 <= (less than or equal to) 8 >= (greater than or equal to) 9 == (equal to) 9 != (not equal to) 3 ! (not) 13 && (and) 14 || (or) The numbers preceeding the operator are their precedence order, where lower is higher priority. Reward: You get to meet Amber. Sample challenge: Q: -(4*5<<2) A: -80 Q: ~0 A: -1 @Xhin: You might be interested in meeting Amber. @Moonray: I've gathered from other posts that you're good at breaking things.
settingsOptions
There are 7 Replies

What did you do?

Posted October 19th, 2017 by Kohlrak

So we're trying to post an expression that is capable of being evaluated, but that she for some reason can't figure out how to evaluate?

What do the numbers next to the symbols mean (like the sevens in front of the rotate and shifts)?

Posted October 21st, 2017 by EN

So we're trying to post an expression that is capable of being evaluated, but that she for some reason can't figure out how to evaluate?

Precisely. Issue is, i don't know whether she can be beat given the rules or not, which is why i posted it. I'm hoping i managed to get all the rules right. XD

What do the numbers next to the symbols mean (like the sevens in front of the rotate and shifts)?

Operator precedence (aka order of operations). The lower, the higher the priority. Normally we wouldn't bother, but we have operations here that aren't in conventional math.

Posted October 21st, 2017 by Kohlrak

1/2 + 1/4 + 1/8 + 1/16 + ...

In "real" math that evaluates to 1. But if she rounds all decimals down to 0, that would give

0 + 0 + 0 + 0 + ... = 0

So I guess a question is, do we have to evaluate expressions as she would?

Posted October 22nd, 2017 by EN

There is a limit, that it must all be typed out.

So I guess a question is, do we have to evaluate expressions as she would?

Yeah, which is why the rules are there. She's not necessarily figurative, but an actual opponent to challenge. I, legit, am not sure if she can be beat following her rules. My issue is, i need challenges, tough challenges, and it needs to be in a way that actually follows the rules that she is expected to follow.

Posted October 22nd, 2017 by Kohlrak