 The first part (the comparison of the king to a mule) comes from Busone de'Raffaelli da Gubbio's "Fortunatus Siculus," written about 1333 in Italian.The second part (concerning the caskets, known to English speakers from Shakespeare's "The Merchant of Venice") originates from about 800 AD from Joannes Damascensus's account of Barlaam and Josaphat and was written in Greek.Boccaccio most likely was inspired, though, by the "Gesta Romanorum".