Before anything, though, I must say that no, king Joash would not know that he must strike the ground five or six times. But, he really should have did that. All verse emphasis mine.
First of all, we would have to look at the reason why Elisha would be angry at an answer to a seemingly minuscule command,
2 Kings 13:14 (NKJV)
14 Elisha had become sick with the illness of which he would die. Then Joash the king of Israel came down to him, and wept over his face, and said, “O my father, my father, the chariots of Israel and their horsemen!”
Joash was grieved and he has acknowledged his loss to his country. At this, Elisha's strength seemed to have returned and the prophet starts to give commands about bow and arrows.
While researching, I came across:
(1) THE TASK TO WHICH JOASH WAS CALLED
Look at (13:14-17) Now what is this business with the arrows all about? Well, lets remember that in Eastern Lands, instruction by means of symbolic actions was common. Do you recall that when Samuel told the self-willed Saul that "the Lord hath rent the kingdom of Israel from thee this day", he "laid hold upon the skirt of his mantle and it rent". (1 Sam 15:27 Acts 21:10) You see, this was a symbolic action. Elisha was symbolically urging God's people to victory over God's enemies. Elisha was being removed from the scene of battle but the fight would still go on. Through this symbolical action, Joash was being called to execute a specific task.
Joash was a young king who continued the sinful traditions of his lineage. However, he still worshipped the Lord outwardly.
2 Kings 13:4-6 (NKJV)
4 So Jehoahaz pleaded with the Lord, and the Lord listened to him; for He saw the oppression of Israel, because the king of Syria oppressed them. 5 Then the Lord gave Israel a deliverer, so that they escaped from under the hand of the Syrians; and the children of Israel dwelt in their tents as before. 6 Nevertheless they did not depart from the sins of the house of Jeroboam, who had made Israel sin, but walked in them; and the wooden image also remained in Samaria.
Elisha then, rendered to the nation of Israel his last sermon in hopes that the threat of Syria may be contained. The prophet tried to rouse the king to act decisively and offensively, instead of being on the defense from Syria. The king, having given up hope, only strikes the ground three times. This three military victories is then fulfilled in 2 Kings 13:25.
This could be symbolic to the many instances when the Lord renders help to believers or kings in the Bible time and time again. But most of the effort were not met with the faith that God expects. King Joash had given up, though he was obedient.
Biography of Joash
Elisha was angry at his halfhearted compliance, telling Joash that since he had shot only three arrows, he would have only three victories over the army of Syria, rather than destroying their war-making power completely, as the LORD had intended.
The story of Jonah is also an interesting look at God's efforts VS response. But if I expound on that, it would not be quite on topic.
Please do tell me if I need to improve my answer. This question is actually very difficult to expound on (due to it being a short chapter) without being too speculative :)