The origins of the "learned pig" are very nearly lost in the proverbial mists of time; the immense popularity of the act led to such a vast number of imitators that it's not easy to be certain which pig came first. Nevertheless, thanks to the researches of G.E. Bentley and the indefatigable Ricky Jay, it's possible to identify the Subject of our Novel, who really was the very first such pig -- from among the plethora of porcine pretenders. This pig was named Toby (a name borrowed by many later pigs), and was trained by a Mr. S. Bisset (exactly what the S. stands for is a bit unclear; some sources give Samuel and some Silas, and one refers to him as John). Bisset, who was said to have been born in Perth, Scotland, took up animal training in the middle way of life; as described by one period source, his newfound passion began when,
"Reading an account of a remarkable horse shewn at the fair of St. Germain's, his curiosity led him to try his skill on a horse and a dog which he bought in London, and he succeeded beyond all expectation. Two monkies were the next pupils he took in hand; one of these he taught to dance, and tumble on the rope, whilst the other held a candle with one paw for his companion, and with the other played a barrel organ. These antic animals he also instructed to play several fanciful tricks, such as drinking to the company, riding and tumbling upon the horse's back, and going through several regular dances with the dog."
From dogs, monkeys, and horses, he moved on to cats -- certainly as "intractable" an animal as one can imagine -- and taught a group of them how to strike their paws upon dulcimers, while yowling along and pretending to read from sheets of music! This "cat orchestra" was his first public success, and to it he added his trained monkeys, horses, and a hare which beat upon a drum with its tail. Having the idea that a pig would be the most difficult animal of all to train, he purchased one and set about putting it through its paces; doubtless he discovered, as have researchers today, that in fact it was one of the most intelligent of animals. Within a year, he took this new act on the road, to universal acclaim.
It was deceptively simple: under Bisset's direction, Toby selected from among a set of pasteboard cards upon which numbers and letters were written; by this means, he asnwered questions from his Master and audience members, told the time from a pocket-watch, picked out married and unmarried people, and even "read the minds of ladies, but only with their permission."
This was in or about the year 1783. In later years, learned pigs -- many of them also "Toby" -- continued to appear throughout the next few decades in both Britain and the United States. Indeed, the act has been revived in the twentieth century, and I would not be surprised to see it practiced again today. But it was Toby who first made his name upon the stage, and whose career inspired PYG.