May not be entirely correct, but I do believe that historically "luck" and "happiness" were much closer to synonymous.
Recall that before many of modern technological and medical advances, one's entire status and well-being was attributed to how the gods favored them. In Europe, especially, the Catholic Church took a good amount of time to ingrain in people that if they were unhappy it was the will of god. As such it makes sense that if you are a "lucky" person, you are also a "happy" person. What person who is unhappy would ever consider themselves lucky? What person who is unlucky would ever consider themselves happy?
There are suggestions that "luck" was borrowed from the German "glück" as a gambling term some time before the 15th century. This would suggest that the word "luck" originated first and "happy" derived from it. In fact, all accounts point to the fact that in English and similar languages the evolution of the word "happy" began with "luck"
http://www.etymonline.com/index.php?search=happy&searchmode=none :
mid-14c., "lucky," from hap "chance, fortune;" sense of "very glad" first recorded late 14c. Ousted O.E. eadig (from ead "wealth, riches") and gesælig, which has become silly. O.E. bliðe "happy" survives as blithe. From Greek to Irish, a great majority of the European words for "happy" at first meant "lucky." An exception is Welsh, where the word used first meant "wise."
Note the Welsh exception, proving that this isn't necessarily a rule, although for the most part a common pattern in the 10th to 15th centuries for "luck" to be equated with "happiness".
"Put two and two together and getting four" is from at least since 1816, see my answer on this similar Q&A.
"Put two and two together and getting five" is from at least 1859.
From The New England farmer: Volume 11, in 1859:
The classes had nearly been through
with their morning lesson, the older
boys and girls had taken slate and
pencil, and were trying to put two and
two together so as to make five, and
all as bust as they well could be when
tap, tap, tap, whir-r-r-r-r-r-r, went
somebody or something on the outside
of the school-house.
Albany de Grenier Fonblanque in c.1860, in Hector Mainwaring; or, A lease for lives
Prudence, as well as inclinination,
urged the match ; for two and two put
together carefullv, will sometimes
make five. Marion's little fortune
would serve at capital to push Clement
on in his profession--he promired soon
to be famous in it--the gallant,
clever lad - and repay her fiftyfold.
The Hon. Mr. Dorion in 1865, in the Parliamentary debates on the subject of the confederation of the British North American Provinces
It is said that this Confederation is
necessary for the purpose of providing
a better mode of defence for this
country. There may be people who think
that by adding two and two together
you make five. I am not of that
opinion.
Here's Frances Eleanor Trollope in the The Fortnightly Review from 1870, in the serialisation of her story Anne Furness:
"He's a cunning man, and knows how to
put two and two together and make five
of 'em 'stead o' four."
So it looks like getting five came a bit later than getting four, and possibly from Canada/north America.
Edit: to include earlier references.
Edit2: Or to look at it another way,
"Two and two is four" is from at least 1655 with plenty of 17th century references.
"Two and two make five" is from at least 1690 with plenty of 18th century references.
Observations upon anthroposophia theomagica and anima magica abscondita by Alazonomastix Philalethes in 1655:
Nay, the points of any other inward
line parallel to this, will do as well
as the points of this middle line,
which is as plainly true, as two and
two is four, if thou understandest
sense when it is propounded to thee.
And also:
This is as true, Tom Vaughn, as two
and two are foure, though I do not
call you Owl for your ignoreance, as
you do me for my knowledge.
A moral essay upon the soul of man: In three parts from 1690:
For as one can never make a Man
believe that a Square hath but three
Corners, and that Two and Two make
Five ; so one can never make him
believe that Ingratitude is an
Ornament to the Nature of Man, that
Injustice merits a Reward, ...
Best Answer
This is right; hap is a root that appears in many English words and its original meaning is indeed that of "good luck". It is traced back to Old Norse (the language spoken by the Viking invaders who entered the English scene during the 9th century.
In Old Norse, you would have these two words:
So that hapless is a synonym for ill fated. This root appears in many English words.
In Old English you would find gehaep for "convenient,suitable".