More than one version of a story in Scripture
There are quite a few instances in the Hebrew Bible where more than one version of a command or story is told. For example, the only way that the tale of the kidnapping of Joseph and his sale into slavery can be understood is that it is a conflation of two versions. In one, Reuben is the brother who tries to save Joseph. In the second, it is Judah. In one, the brothers take Joseph from the pit and sell him to Ishmaelites. In the other, Midianites lifted Joseph from the pit and sold him to Ishmaelites.
Another example is the two distinct and opposing narratives in Jeremiah. In one account, Jeremiah returns home in Anathoth after being released from prison. In the other, he goes to live with Gedaliah in Mizpah.
Joshua 8 also contains two conflicting accounts. In verses 3-9, Joshua assembles a troop of thirty thousand to hide in ambush and be prepared to attack the city Ai when Joshua signals them when he sees its soldiers leave the city to battle the apparently-fleeing Israelites. A variant account appears in 10-13 where the number of ambushers is five thousand. Both accounts state that the troop was placed in the same spot, the language in both is virtually identical, and in both, after making the assignment, Joshua goes to sleep.
When did the Israelites attack?
Verse 14 states that the Ai forces left the city to battle the Israelite lamoed, “the appointed time.” In context, this could be understood that the Ai soldiers attacked at the time set by their king, when the king thought the Israelites were retreating. However, Rashi states that the word refers to the Israelites and the time was set by soothsayers who told Joshua the most propitious time to attack.
Numbers 3 and 7
I pointed out in the past that the numbers three and seven reappear frequently in Scripture. This occurs in this chapter in the number 30,000 and the key word of the chapter, a-r-v, “ambush,” appears seven times to highlight it.
Biblical interpretive principles
The first century sage Rabbi Ishmael is credited with the creation of thirteen biblical interpretive principals. His twelfth principle is “A matter can become clear from its context or from what is stated latter.”
We see this playing out in this chapter. God tells Joshua to do with the king of Ai what he did to the king of Jericho, but what he did is not mentioned here but only in verse 29: he is hanged.
Similarly, Joshua tells the ambushers in verse 4 to rise from their concealment and attack the city Ai, but the text does not reveal how he informs them when to do so until verse 18 when he signals with a raised javelin.
Also God does not tell Joshua to burn Ai, but Joshua tells his troops to do so in verse 18 “as God commanded,” thereby informing us that this was part of the divine communication.
Another common biblical style id that it very frequently uses the singular when current Hebrew would have the plural and vise versa and is not strict about its use of gender, switching masculine and feminine. An instance of the former is in verse 25 when the verb vayehi is singular although it is immediately followed by the plural hanoflim.
Why did Joshua take troops from “all the people of war” and not from the two and a half tribes who promised Moses and Joshua that they would lead the Israelites in battle? Why didn’t Joshua seek peace with the cities of Jericho and Ai before attacking them, as Moses did in Deuteronomy?
 In Genesis 37:18-30.
 Chapters 39 and 40. This is noted by the highly respected Orthodox Rabbi Dr. Binyamin Lau in his book Jeremiah, Maggid, pages 195 and 196. He mentions other sources that discuss the two accounts.
 Needless to say, commentators such as Rashi interpret all of these conflicting accounts as two parts of a single event. In this case, Joshua at first thought that a ambushing force of thirty thousand was sufficient, but then decided to increase the number. Although both accounts place the two groups in the same location, they say that the five thousand were set closer to Joshua’s camp so that they could see his signal better.
 Hillel who lived about two centuries before him outlined seven principles. The thirteen are in the Siddur, prayer book, and recited each morning in the beginning of the service, apparently to highlight how the Torah should be understood. His view was “The Torah speaks in human language,” as people speak and write, so that it can be understood. While Rabbi Ishmael took a literary and practical approach to the understanding of Scripture, his colleague Rabbi Akiva felt that since God composed the Torah, every single letter has meaning; meanings that only scholars can understand.
 The Greek translation Septuagint noticing that God did not include this instruction, deletes it from verse 18.
 Deuteronomy 20:10. It is possible that although unmentioned the two and a half tribes led the Israelites and Joshua did offer peace, although as we will see in the next chapter, it seems that Joshua felt God did not want him to offer peace.