Not only is C.S. Lewis's argument valid, but it is also finding its quantification and articulation in computer science.
Unsupervised Learning
The closest approximation that we can come to Lewis' idea of an accident giving "a correct account of all the other accidents" is in the field of machine learning. Within that field, there is a distinction made between supervised and unsupervised learning based on whether or not training data is utilized to prepare the computer for the actual test data. In the case of unsupervised learning, the computer is presented with the test data with no preparation. Although this may appear to be learning from a Lockean tabula rasa, the fact is that even in unsupervised learning, certain assumptions are always incorporated to make it possible for the computer to process the data:
"In the classical literature, most unsupervised learning algorithms
are essentially algorithms for performing on-line clustering of the
data. They are based on the assumption that clusters are likely to
correspond to categories — an instance of the general epistemological
assumption that 'nature is not a cryptographer.' This important
assumption, which has extensive empirical support even if its
philosophical status is not entirely clear (Wigner 1960), provides
justification for the study of unsupervised learning algorithms. The
need for such assumptions however is not restricted to the
unsupervised learning paradigm - assumptions that nature is 'simple'
are also necessary for the theory of supervised learning. The major
problem in supervised learning is that of interpolating from the
categories of the data in the training set to the categories of novel
inputs. Such interpolation can only be based on assumptions about the
simplicity of the natural process that generates the data." (Michael
I. Jordan and Robert A. Jacobs, "Modularity, Unsupervised Learning,
and Supervised Learning")
Peter Dayan of MIT also comments on the need for a priori information as one of the prerequisites for unsupervised learning:
"The only things that unsupervised learning methods have to work with
are the observed input patterns xi, which are often assumed to be
independent samples from an underlying unknown probability
distribution PI [x], and some explicit or implicit a priori
information as to what is important." (Peter Dayan, "Unsupervised
Learning")
Any type of algorithm that is used for machine learning starts with assumptions with respect to the existence and value of data. These assumptions are programmed into the algorithm, and the computer is given all the tools that are necessary to collected data and perform various statistical operations on it. Far from being accidental, unsupervised machine learning involves sophisticated statistical operations and computation.
No Free Lunch
In spite of the fact that machine learning has a priori knowledge as its starting point, not all algorithms are created equal and no given algorithm is successful for all types of data. The study of this particular problem resulted what is known as the "No Free Lunch" (NFL) theorem, published in 1997 by David H. Wolpert and William G. Macready.
"Roughly speaking, we show that for both static and timedependent
optimization problems, the average performance of any pair of
algorithms across all possible problems is identical." (Wolpert and
Macready, "No Free Lunch Theorems for Optimization")
Even though the average performance of algorithms is identical when tested with all types of data, a given algorithm may be especially suited for a particular type of data. However, the NFL theorem also implies that its performance will suffer when tested with data for which is not suited.
"[T]he main message of the NFL theorems may be summarized as follows:
If there is no restriction on how the past (already visited points)
can be related to the future (not yet explored search points),
efficient search and optimization is impossible." (Christian Igels,
"No Free Lunch Theorems: Limitations and Perspectives of
Metaheuristics")
Succinctly expressed, the NFL theorem holds that not only are assumptions made when designing algorithms but their success is fully dependent on those assumptions:
"[I]f the practitioner has knowledge of problem characteristics but
does not incorporate them [...], the NFL theorems establish that there
are no formal assurances that the algorithm chosen will be at all
effective." (Wolpert and Macready, "No Free Lunch Theorems for
Optimization")
"[Y]ou can't make a clustering algorithm without making some
assumptions about the nature of those clusters." (David Robinson)
Even if it were possible for a genetic mutation to accidentally equip an organism with the ability to perform the biological equivalent of statistical calculations on its own physiological states, the practical utilization of those calculations has been demonstrated to be useless without some sort of a priori guidance. For this reason, the idea of accidental knowledge is and always will remain theoretically implausible.