# Counting Number of People in Building Given Entry/Exit Data

I've been asked to analyse entry/exit data for an office to find out the minimum number of people present in the building for fire safety reasons. The building operates 24/7 so there should always be more than one person present.

I can say how many people have entered, and how many people have exited, but the data is anonymous so I can't say who has entered or exited.

I am using the formula below to work out how many people are in the building:

Present(n) = Present(n-1) + Enter(n) - Exit(n)

I think this can pick up trends - when people tend to enter and exit, and when it is likely there are few people around, but it cannot tell me how many people are in the building because I don't have Present(n=0), and as far as I'm aware this is not something we have.

I am sure there is a way to do this, but I have hit a dead end and would really appreciate some advice.

• so what you are looking for is advice on how to get a useful and reliable estimate of the initial conditions at the start of recording? Is it an option to have a head count carried out at a specified time (while you count exits and entries)? What are the requirements for accuracy? Do you need to get the exact headcount so fire fighters know exactly what how many people may need rescued? Or do you want an estimate within a few percent of the true value? Jul 23, 2018 at 8:33
• @ReneBt Yes that's correct. The data is from building entry/exit using a smart card. There isn't scope to do any more surveying, other people on the project think I can figure it out using the entry/exit data. Jul 23, 2018 at 12:14
• Is the building ever emptied, such as when fire alarms go off? Buildings I've worked in typically have several fire drills each year and have fire alarms go off for a variety of unplanned reasons (almost never actually to do with fire) typically once or twice a year, and we can't re-enter until it has been cleared by the fire brigade. That would give a time at which you know n=0 (or very nearly) for at least a short period (between the last fire-warden's exit and the first firefighter entering). You'd only need one on record. Jul 24, 2018 at 10:11
• i think it is not possibe as you need an id. try to find an id and it should be possible. Dec 10, 2021 at 9:50