Now whether that parameter was designed deliberately to focus on people of certain names, religion, background, nationality or race is a different story altogether.
On the face of it, Khan may have been randomly picked out by the US Bureau of Citizenship and Immigration Services' database. The system at the airport threw up Khan's name for any number of variable reasons. It is hard to speculate on the algorithm that triggered it.
Someone might argue that the Khan = Muslim = possible terrorist = detention logic, although profoundly offensive, it seems to have been built into the system with the rationale that it is better to humiliate a thousand innocent Khans than let a potential terrorist Khan enter the US.
However, this explanation does not make sense because Khan has been visiting the US for many years. As a matter of fact, he only recently finished a shooting schedule of his latest film "My Name is Khan", which ironically deals with the kind of stereotyping and profiling that he just experienced.
Isn't the Bureau's database designed in a way where the immigration officer, who detained Khan, could have instantly pulled up the actor's record and known about his many past visits? Apparently not, because once the system randomly selects someone it is expected of the officer in question to go through the standard procedure of detention for questioning.
At some level it is understandable that the whole security apparatus has been designed to not just take out potential terrorists in their first attempt but to disrupt their operation at any and every stage. No one at the Bureau is likely to acknowledge that the system works the way it does because of a built-in combination of intelligent and brute logic as well as preordained bias.
Forget the Bureau's own database; a simple Google search of Khan's name would have at the very least made the detaining officer question his action. There are 3, 610, 000 search results of his name on Google.
Depending on when it is searched this number is sometimes even higher. Such a Google search should have stopped any reasonable immigration officer in their tracks to wonder that for a terrorist, Khan has managed a fantastic cover of being one of the world's biggest movie stars.
Perhaps behind creating a security system that depends as much on brute and random logic as intelligent sifting was the deeply embarrassing case of Mohammad Atta, the ringleader of the 9/11 terror attacks.
In 2005, Navy Captain Scott J. Phillpott, who was in charge of the Pentagon's counter-terrorism project codenamed 'Able Danger', created a stir when he said in January 2000 his team had identified Atta as a member of an Al-Qaeda terror cell operating in Brooklyn, New York.
And yet Atta was able to travel in and out of the US unmolested. Atta's lapse was attributed to the fact that he first went by part of his name as Mohamed el-Amir and eventually travelled to the US in June 2000 as Mohammed Atta.
The result of the security churning that followed 9/11 was the compilation of a list of nearly 1.1 million names who were either terror suspects or people of interest by the Federal Bureau of Investigation (FBI).
The list has been a subject of serious scrutiny and criticism by civil liberties groups, which believe it is sweeping in its reach and more often than not throws up those who have absolutely nothing to do with any terrorist groups.
An internal audit report recently quoted by The Washington Times underscored the failures in managing the list. It said there were at least 10 people who should have been kept out of the US according to the list but were allowed to enter while there were many more who should not have been on it but remain there.
It quoted Democratic Senator Patrick J. Leahy, who as the chairman of the Judiciary Committee has oversight of the FBI, as saying "that the FBI continues to fail to place subjects of terrorism investigations on the watch list is unacceptable".
"Disturbingly, (the) report reveals that in 72 percent of the cases, the FBI has also failed to remove subjects from the list in a timely manner.... Given the very real and negative consequences to which people on the watch list are subjected, this is unacceptable."
It is not clear whether Khan's name is on this list or not but the fact he showed up on the immigration's database it is conceivable that a similar name is on it. However, it should be rather easy for the law enforcement agencies to specifically exclude someone of Khan's global recognition from such a list.
Now that every visitor to the US and even permanent residents are fully fingerprinted on arrival every time it is hard to comprehend why specific names attached to specific fingerprints and passport numbers cannot be exempted. For some reason once a person gets on the FBI watch list it is very difficult to get off. The Washington Times story said some 65, 000 names were audited and more than a third of it were outdated.
Security experts say that the random selection parameter is designed to make preventive determination more effective. They acknowledge that one of the negative fallouts is that many innocent people get singled out because of this parameter.
They also point out that when the national threat index is higher the system is designed to become less discriminating. In simple terms, during heightened alerts it is possible that the system will sweep up many more people with a set of specific names and backgrounds than it would normally do.
According to the Department of Homeland Security, for all domestic and international flights, the current US threat level is High, or Orange, which is just below the highest Red. That may partly explain how the actor was singled out because of his name. It is a form of profiling based on many parameters such as names, religion, ethnicity and nationality.
As Khan acknowledged the immigration officials were polite but the question is not one of etiquette but effectiveness. Khan managed to stir up those who matter because of who he is. Lesser mortals might have had to go through a more nerve-racking experience once red flags go up against their names and they are asked to step aside at the immigration counter.