Teacher: what is 117 + 3?
Pupil: 5!
Teacher: correct
In order for that to be correct you need to take several factors into account
Kindly don't disclose them, let others think about it.
I deliberately didn't list them so as to keep others guessing
That's what I was going to say!
Rather exclamatory response for a student, donchathink?!
If A = 117 and B = 3, then A + B should get to 5 ? That is easy:
String A = "117";
String B = "3";
void setup()
{
Serial.begin(115200);
String C = A + B;
String D = String(A.toInt() / B.toInt());
int X = sqrt(C.toInt()) / sqrt(D.toInt());
Serial.println(X);
}
void loop() {}
Try it in Wokwi: Easy - Wokwi ESP32, STM32, Arduino Simulator
Psst, there is no need to guess!
What a โ idea.
It's very correct...
Very expert student.
There is a very good book about the "skills" of mathematics.
You It shows a series of "mistakes" and also fun math solutions.
He's great for young people.
I think it only exists in Portuguese.
The author tells the story of Beremiz Samir, a traveler with the gift of mathematical calculations, who handles numbers with the ease of an illusionist.
It's called "The Man Who Calculated - Malba Tahan"
( " O homem que calculava - Malba Tahan ")
Ref: O homem que calculava - Malba Tahan
PS: English version:
"https://www.amazon.com.br/Man-Who-Counted-Collection-Mathematical-ebook/dp/B01AH39NNO#:~:text=Malba%20Tahan%20is%20the%20creation,mathematics%20to%20a%20wider%20public."
How droll.
One can do it all logically without any square roots...For example.
const byte A = 117;
const byte B = 3;
void setup()
{
Serial.begin(115200);
byte C = A >> B;
C = ((C & 0b00001010) >> 3) | (C & 0b00000100);
Serial.println(C);
}
void loop() {}
Got it! Maybe I am slow as a , but the hints above did not really help...
I think they were instead meant to obfuscate.
I don't understand the code examples. It's just:
117 + 3 = 5!
The code to prove that would look like:
Click here for spoiler
int fivePrime;
for int(i=5; i>0; i--){
fivePrime *= i;
}
if(117+3 == fivePrime){
Serial.print("Student is correct");
} else {
Serial.print("Student is incorrect");
}
What do you have to smoke to come up with such a brilliant idea ?
Sorry. I edited to cover it up.
How about I abuse my moderator powers and edit away the answers that give away how it works?
It's bar sport. Do what thou wilt.