Over the years I have found people that with a lot of pride state they are descendants of Charlemagne, the first Holy Roman Emperor. I find this funny because the mathematician Jack Lee has demonstrated that there is virtually no chance that anyone of European ancestry is not a descendant of Charlemagne.
Counting the total number of ancestors (remember that ancestors increase exponentially each time you move back one generation), he calculates the probability that none of the 40th-generation ancestors is Charlemagne. For that to happen, every one of your half trillion male ancestors has to NOT be Charlemagne, which would be an amazing coincidence.
This probability turns out to be an incredibly small number: about one chance in 1015,000. That is a one with 15,000 zeroes after it, a number that's too big even to display in a browser window. In summary, if you have European ancestry it's virtually impossible that Charlemagne is not among your direct ancestors.
Edward III King of England
On a similar line Mark Humphrys has completed a similar analysis but with the reverse approach. Instead of going bottom to top (present to past), he has done the analysis top to bottom. Starting from King Edward III (born 1312) he counts the documented descendants and calculates against reliable estimates on the population of England. For the generation born around 1977, the calculated probability of no descent drops to 1.4x10-26.
In summary, there is an extremely high probability, approximately 99.7% that a modern English person with predominantly English ancestry descends from Edward III.
How about Spain?
The same rules are applicable to Spain and if you have predominantly Spanish ancestry it is virtually impossible that you do no descend from Bermudo I King of Asturias.
The number of descendants of Bermudo I must include nearly all the population of Spain, and probably a large percentage of the population of Latin America. Documenting one's own descent from the early Spanish monarchy is, however, another matter! Tracing this ancestry is challenging but in many cases it is possible with a certain degree of reliability. This is the general outline:
Civil Records - Century XX and XIX
Church Records - 1800 to 1600
Notary Records - 1600 to 1400
Spanish and Portuguese Nobiliarios - 1000 to 1300
National Archives - 1000 to 1300 (manuscripts to confirm the information in the Nobiliarios that sometimes is unreliable / inaccurate)
Of course I am not saying this is an easy task, but with patience and expertise of a professional genealogist in many cases it is possible to put together the pieces of this puzzle.