This story is commonly known in Japan, and can be found in many forms online. The version below is largely translated from this website.
Once upon a time there lived a man with a clever son. One day, while he was working in the field, a local lord passed by on his horse.
This particular local lord was known for enjoying asking impossible questions to the villagers and they all hid when they saw him coming.
However, that day, the man was working particularly diligently and didn’t see the lord until he was in front of him.
The lord quickly asked, “How many times have you hit the earth with your hoe today?”
“Oh..um…I haven’t been counting,” said the man.
“I will come back again later. You had better figure it out by then, or I will punish you,” said the lord and rode away.
The man was troubled, but happily his clever son arrived to help in the field. The man explained his predicament.
“Oh, that’s easy,” said the son. “Just answer 18,000 or something and then ask the lord how many steps his horse has taken today.” The boy went back home.
The lord later returned and asked, “Have you remembered?”
“Yes, exactly 18,000. By the way, how many steps has your horse taken today?”
Realizing the man had had help, the lord stammered, “W-what? Who suggested you ask me that?”
The man replied it was his son.
The lord said, “I have this medicine here. If your son drinks it, he will be even smarter.”
The man took the medicine to his home. He gave it to his son and said, “The lord said if you drink this, it will make you smarter!”
The boy replied, “If there were such a medicine, there would be no stupid people in the world,” and threw the medicine away.
The next day, the boy and his father were out in the fields again when the lord approached. “Hello boy, did you drink my medicine?” he asked.
“Yes! Thanks to you I am much smarter today!” said the boy.
The lord was shocked. He had intended to give the child poison. The lord quickly rode back to his castle. He took a bottle of the same medicine and drank it in one gulp.
The wicked lord died on the spot.