@Jane10
The numbers aren't traceable. Your name is crossed off on the list and you're given a numbered voting slip, but no record is made of which number you're given.
I explained somewhere or other how the stats were worked out. There were no public exit polls for the referendum, although there were some private ones and YouGov did a survey. However, the demographic profile of voters was worked out by more sophisticated methods by a team of statisticians, etc. Some of the work is done by Manchester Uni. My daughter explained the methods to me, but I'm not sure I understand it all. They've been extremely accurate in the past, so no reason to think they've got it wrong this time.
They take an electoral ward with a demographic profile as average as possible, then compare those results with wards which are known to have different ranges for age, income, educational qualifications, etc. The base data comes from census information, council tax records, etc.