I'm not aware of any kind of reliable figures for the population of Scotland at that time. In the mid-ninth century the older "Scottish" peoples, the Picts and Scots (an originally Irish tribe from Ulster) held only about half of present-day Scotland, with Danes and Angles (ie, Vikings) having seized the rest. I've read of estimates ranging anywhere from 20,000 to 100,000 but I doubt that there is any factual data for any of these, which are simply wild guesses. We know there was a battle in Scotland in 904 in which one side (Picts) lost about 500 men, so there was obviously a population large enough for farming and basic trade, and communities large enough to still survive such losses, but that tells us nothing concrete about the totals of populations in specific communities or as a whole.
In 840 in Dalriada, Kenneth McAlpine, King of the Scots, was accepted as king by the Picts also, becoming the first more-or-less true king of Scotland. The historic Macbeth was king in the 11th century, assasinating Duncan in 1040, but there is little more information available in terms of population then. As far as I'm aware the first real census of Scotland did not take place until 1801.