The Philosophy of Chance, with subtitle "Literature in the Light of Empiricism" (Polish: Filozofia przypadku. Literatura w świetle empirii) is an essay by Polish author Stanisław Lem on the literary theory and the influence of literature on the modern culture. However, as literary critic Henryk Markiewicz noted, the subtitle is somewhat misleading: starting with Lem's take on literary theory, the essay turns into the "General Theory of Everything": of the Universe, evolution, and culture, based on a premise that chance, eventuality is the universal factor.
The essay was first published in 1968 by Wydawnictwo Literackie as a book of over 600 pages.
In the essay, Lem criticizes the contemporary literary theory, in particular, with Roman Ingarden's Literary Work of Art, and proceeds with his own. He cautions that he deals only with the ontological side of the issue, disregarding the esthetical side of literature.
Lem's exposition draw on analogies from various natural sciences: probability theory, information theory, computer science, etc. The major idea is that a literary work must be considered as an infinite set of its readings. The literary text per se is just an "input instruction set" of an "information program", and each reader subject to it produces a particular concretization, which depends on the reader's worldview at the moment of reading, which, in its turn, depends on the established cultural norms. For example, Lem notices that Kafka's "In the Penal Colony" immediately brings associations with Nazi death camps in modern reader's mind, although in 1914 Kafka could not have been describing these camps. This observation gives Lem an incentive to consider unpredictable arbitrariness in the literary analysis of a particular text.