Also in Star Trek VI Spock states "An ancestor of mine maintained that if you eliminate the impossible, whatever remains – however improbable – must be the truth."
This ancestor is likely what fictional character, later a holodeck favorite of Lt. Commander Data's
Sherlock Holmes