obligatory vs optional

obligatory

adj
  • Requiring a matter or obligation. 

  • Imposing obligation, legally, morally, or otherwise; binding; mandatory. 

optional

adj
  • Not compulsory; left to personal choice; elective. 

noun
  • In various programming languages, a kind of variable that is assigned a specific data type but may or may not hold an actual value. 

  • Something that is not compulsory, especially part of an academic course. 

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