How many books were available to an educated ancient Israelite?
For the time being, I am accepting the assumption that literacy was not widespread in ancient Israel even though I am aware of evidence that suggests that literacy was more widespread than most assume. You basically need at least one person in every village (about 200-250 people) that can read or write to serve as the scribe and larger places would need more than one scribe simply because the work load would require it. People from hamlets or outlying homesteads would have to go into town if they needed a scribe.
Most documents from antiquity simply do not survive. Most of them are written on perishable surfaces. They are destroyed, on purpose, on accident, with the passage of time. Many of them are buried and never found. Even of a civilization filled with writing, like ancient Egypt, only a small fragment of what once existed survives. Most of it is gone, mostly irretrievably so. Consider the example of P. Wilbour. This is a large scale tax survey of farmers and their produce. There should have been at least one of these rolls for every one of 42 nomes for the three thousand year span of pharaonic history. There should have been at least 126,000 of them. We have one. So the vast bulk of the documentation that once existed does not survive.
Evidence for writing in ancient Israel dates at least to the tenth century. Given that this is the time of the rise of the kingdoms of Israel and Judah, this is about what we should expect. Archaeological finds of writing are a small percentage of what was produced. Thus in order to expect to find any writing, much needs to be produced. The main reason for writing to be produced are for legal and administrative reasons. The bulk of ancient writing finds are actually administrative documents. So if you want to find documents of any sort, you usually need to have a state with a bureaucracy. This does not mean that writing and literacy were not available earlier but it would be harder to find archaeologically.
Granted that the amount of administrative and legal material (often grouped together as documentary materials) would be the bulk of writing, we need to consider what percentage of surviving material we could expect to be literary (what we would think of as being part of a library). In Ugarit (a coastal town destroyed about 1200 BC that spoke a language closely related to Hebrew) they have published 1418 Ugaritic tablets (a number of Akkadian and Hurrian tablets have also been published), 176 of which are literary. That amounts to about one literary tablet for every eight tablets. On the Trismegistos database, of 76,182 Greek documents 11,219 are literary (covering over 4000 authors). That is about one in seven texts. So the numbers are roughly consistent between the two corpora and the number of texts in each case is statistically significant.
We can also define two other ratios. In Ugaritic tablets there are 17 times as many literary texts as legal texts. In Greek texts there are 1.5 times as many ostraca as literary texts.
In ancient Israel (and I include Judah in this as well), the major writing surface was papyrus, but only one pre-exilic papyrus has been found. (Papyrus decays in moist climate and while there are desert places in Israel the population tends to live in places that are not conducive to papyrus preservation; this is true of Egypt too.) Nevertheless, thousands of bullae have been found. Bullae are the mud seal impressions from papyrus documents. If later documents are any indication, they were used on legal texts. Even if we assume that the 161 bullae published by Avigad and Sass were the only ones from ancient Israel, if the ratios from ancient Ugarit hold, we should expect that there were at least 2700 literary papyri from pre-exilic Israel that would have survived if the climate did not destroy papyrus. Many of these would have been duplicates but with those numbers we could expect about 900 literary compositions (based on Greek ratios). Let's take that as a high estimate. (If we wanted an ultra-high estimate we would base it on the thousands of bullae found and multiply it five-fold: 13500 literary papyri with 4500 literary compositions. Let's err on the side of caution.)
A lower estimate would be to take the number of ostraca that have survived. Wimmer published 133 that had hieratic numerals, but Dobbs-Allsop lists 228 Hebrew ostraca from excavations. There is a partial overlap between these groups of texts. Rather than sorting out the total number of ostraca, I will just take the latter figure. Doing so yields an expectation of 152 literary texts which should total about 51 different works. Let's take that as a low estimate. By comparison, the Hebrew Bible comprises 39 works, 12 of which (1-2 Chronicles, Ezra, Nehemiah, Esther, Lamentations, Daniel, Ezekiel, Zephaniah, Haggai, Zechariah, Malachi) are definitely post-exilic, leaving at most 27 pre-exilic books, two of which (2 Kings, Jeremiah) did not receive their final form until after the exile. So the low estimate yields about twice as many literary works from pre-exilic Israel as we have preserved. (The high estimate yields twenty-three times as many works as have survived in the Hebrew Bible.)
We can look at the problem another way. Dever estimates the population of the divided monarchy at about 150,000 people (The Lives of Ordinary People in Ancient Israel, 72). One scribe for every 500 people would mean that each harvest month (and different crops had different harvest times), the scribe would have to deal with 15-20 taxpayers a day all month. (Note that this is a smaller ratio of scribes per people than I used above.) That ratio still gives 300 scribes in the country. Spreading 152 literary papyri (our low estimate) over 300 scribes means that only every other village had a literary scroll. The high end estimate means that a typical village has on average only 9 literary works in the whole village (some would have more and some less). These numbers seem at least reasonable; but they are still guesses.
These papyri would be only a part of what once existed. It
would be a mistake to assume that only what has survived in the Bible
was what was available in ancient Israel and Judah.