example vs sample

example

verb
  • To be illustrated or exemplified (by). 

noun
  • Something that serves to illustrate or explain a rule. 

  • Something that serves as a pattern of behaviour to be imitated (a good example) or not to be imitated (a bad example). 

  • Something that is representative of all such things in a group. 

  • A person punished as a warning to others. 

  • A parallel or closely similar case, especially when serving as a precedent or model. 

  • An instance (as a problem to be solved) serving to illustrate the rule or precept or to act as an exercise in the application of the rule. 

sample

verb
  • To take or to test a sample or samples of. 

  • To reduce a continuous signal (such as a sound wave) to a discrete signal. 

  • To make or show something similar to a sample. 

  • To reuse a portion of (an existing sound recording) in a new piece of music. 

noun
  • A small quantity of food for tasting, typically given away for free. 

  • A subset of a population selected for measurement, observation or questioning, to provide statistical information about the population. 

  • Gratuitous borrowing of easily recognised phases (or moments) from other music (or movies) in a recording. 

  • A part or snippet of something taken or presented for inspection, or shown as evidence of the quality of the whole; a specimen. 

  • A small piece of some goods, for determining quality, colour, etc., typically given away for free. 

How often have the words example and sample occurred in a corpus of books? (source: Google Ngram Viewer )