The purpose of the census was to provide accurate and detailed statistical information about the country to enhance government decisions. This was arguably an approach that had been pioneered by Sir John Sinclair with the Statistical Account of Scotland - a monumental work that introduced the word statistics into the English language.
It seems a fitting day, then, for us to have completed phase one of our Scottish surnames project. The idea is really quite simple - to investigate the frequency and geographical distribution of surnames in Scotland using, among others, census records. In our client and transcription work, we have built up a large database of surnames - over 8,500 so far - found in Scottish historical records. We want to know how common each of these surnames is in Scotland, and whether they are more common in any particular part of Scotland.
Phase 1 of our project - which is now complete - entailed counting the number of times each surname is found in each of Scotland's 33 historic counties, and in the four largest cities (Aberdeen, Dundee, Edinburgh and Glasgow). Even the data-gathering part of this phase was a major task - we conducted over 300,000 database queries before we could even begin crunching the numbers.
Having got the raw data, we then compared the number of instances of each surname  in each county with the total population of that county, giving the number of instances of each surname per 100,000 people in each county (the surname density). We then compared each county-frequency value with the equivalent figure for the whole of Scotland, to get an indication of relative surname density. 
The higher the relative surname density, the more common the surname is in that county compared to Scotland as a whole. Our working hypothesis is that the higher the maximum relative surname density for a particular surname, the more likely that surname is to have a geographic origin in that area. We will be looking to test that hypothesis using a selection of surnames with known geographic origins. 
A corollary to this initial hypothesis is that the lower the maximum relative surname density, the less likely the surname is to have a specific geographic origin. This appears to be borne out to some extent by the surnames with the lowest maximum relative surname density, shown in the table below
Several other interesting facts emerge from the initial results of this study.
- 19 different surnames are the most common surnames in individual counties/cities (Brown in 6, Campbell, Roberston and Smith in 4, Thomson in 3, Grant and Scott in 2, and Bell, Fraser, Hunter, Macdonald, Mackay, Mackenzie, McCulloch, Mcmillan, Milne, Sinclair, Stewart and Sutherland in 1).
- Perthshire has the most unique surname variants not found in any other county (55), followed by Fife (50), Angus (49), Ayrshire (48), Kirkcudbrightshire (47), Renfrewshire (43), Orkney (39), Lanarkshire (35) and Aberdeenshire (34).
- The top 10 surnames in Sutherland account for 63.26% of the entire population. Nearly one in five people in Sutherland in 1841 were Mackays. By contrast, the top 10 surnames only accounted for 9.6% of the population in Wigtownshire and 9.8% in Renfrewshire.
- By one measure, Clackmannanshire, Dumfriesshire and Wigtownshire have the most distinctive top-ten surnames - only 5 of the top 10 surnames in each of these counties appear in the top 10 surnames of any other county.
 For example, there were 1580 Browns in Aberdeenshire in 1841. The total population of Aberdeenshire was 193,062. This means that the surname density for Brown in Aberdeenshire is
Surname density (Brown in Aberdeen) = (1580 / 193,062) * 100,000 = 818.39
Surname density (Brown in Scotland) = (28,617/2,589,636) * 100,000 = 1105.06
Relative surname density (Brown in Aberdeenshire) = Surname density (Brown in Aberdeenshire) / Surname density (Brown in Scotland) = 818.39 / 1105.06 = 0.7406