Or in a baffling mystery. What is the baffling mystery? How to provide the Moriarty program with a physical body that can leave the holodeck?.
No. NO. No! NO! NOOOO!!!
The mystery is why they didn't provide the Moriatry program with a physical body capable of leaving the holodeck in a week or a month or so.
If you don't understand why there is no problem with creating a physical body for the Moriarty program, try thinking about it. Forget about the nature of holodeck matter. Consider the nature of your existence.
If after thinking about you still need an explanation, read on. Sigh.
Forget about your body with it's atom and molecules. Your body is not you. So what are you? The answer is that in a certain sense, your aren't. In a certain sense, you don't exist. You don't have any real physical matter or energy, your body and brain have physical matter and energy. And you body and brain think that you exist. You are a delusion that your body and brain have, a delusion that you exist.
Think of a wave in the ocean. The wave is not a group of water molecules. The wave is a pattern of movement that moves through the water, affecting the motion of water molecules and passing on, leaving the molecules behind. And you are like a wave pattern moving though molecules of solid, liquid, and gaseous substances. If you think of people in a stadium doing the wave, you think of the people as being real and important, and so you don't think of the wave as a thing or a reality, merely a pattern. But actually, you and the people in the stadium are also merely patterns passing through matter and energy.
Or think of yourself as a program in the biological computer that is your brain. The brain thinks and feels thoughts and emotions, and those thoughts and emotions are you.
How do you interact with the physical world? You sensory organs send signal to the sensory regions of you brain which interprets them as sensations. When you decide to do something, your brain sends signals to your body parts ordering actions.
So what is the Moriarty program? It is a computer program in one or more of the computers that make up the computer system of the Enterprise. When the Sherlock Holmes program is being run on the holodeck, the holodeck computer and program decide what sensory input the Moriarty program and send that information to the computer system running the Moriarty program. When the Moriarty program and its computer decide to do something they send signals to the computer running the Sherlock Holmes program on the holodeck to take that action.
Suppose you lean over a sink full of water and drop your glasses into it. You reach in with your arm and pick up the glasses and pull them out of the water. you are not in the sink full of water, you are inside your brain.
The Moriarty program was never in the holodeck, it was in a computer some distance away from the holodeck. The only things it could sense were events in the holodeck, and the only actions it could take were actions in the holodeck using its body made of holomatter, because that was the way it it was connected to the outside world.
There was no problem getting Moriarty out of the holodeck, because he wasn't in it. He was in the computers of the Enterprise, which were outside of the holodeck and not made of holomatter. The problem was enabling Moriarty to interact with matter and energy outside of the holodeck. The solution was to give Moriarty, a computer program in a computer system, much as you are a computer program in a computer system, sensory and command connections to a robot body made of normal matter existing outside of the holodeck.
I guess that the first body they would give to the Moriarty program might be like this.
The Death Star "mouse Droid" from Star Wars:
http://starwars.wikia.com/wiki/MSE-6-series_repair_droid
Then, if Moriarty behaved himself for a while, they might give him a larger body, like Dr. Theopolis in Buck Rogers:
http://buckrogers.wikia.com/wiki/Theopolis
And then if Moriarty continued to behave they could give him a body like Twiki in Buck Rogers:
http://buckrogers.wikia.com/wiki/Twiki
And then if Moriarty continued to behave they could give him a body like the remote controlled robot used by Nigel from England in the "ReplicANT" episode of A.N.T. Farm, or the remote controlled robot used by Liam in Bizaardvark.
And they might eventually have given Moriarty a Soong type android body resembling his holodeck image as Professor Moriarty (but probably with some visual differences to make it clear it was an android body) but without the positronic brain since it would continue to be remotely controlled by the Moriarty program in the Enterprise computer system. But I doubt that they would give that android body Data's strength.
So why didn't they do that a few weeks or months after "Elementary My Dear Data"? My guess is that a high ranking Starfleet Admiral was a big Sherlock Holmes fan and ordered them to cease and desist making a robot body for a computer program simulating and emulating Holmes's arch enemy!
No. NO. No! NO! NOOOO!!!
The mystery is why they didn't provide the Moriatry program with a physical body capable of leaving the holodeck in a week or a month or so.
If you don't understand why there is no problem with creating a physical body for the Moriarty program, try thinking about it. Forget about the nature of holodeck matter. Consider the nature of your existence.
If after thinking about you still need an explanation, read on. Sigh.
Forget about your body with it's atom and molecules. Your body is not you. So what are you? The answer is that in a certain sense, your aren't. In a certain sense, you don't exist. You don't have any real physical matter or energy, your body and brain have physical matter and energy. And you body and brain think that you exist. You are a delusion that your body and brain have, a delusion that you exist.
Think of a wave in the ocean. The wave is not a group of water molecules. The wave is a pattern of movement that moves through the water, affecting the motion of water molecules and passing on, leaving the molecules behind. And you are like a wave pattern moving though molecules of solid, liquid, and gaseous substances. If you think of people in a stadium doing the wave, you think of the people as being real and important, and so you don't think of the wave as a thing or a reality, merely a pattern. But actually, you and the people in the stadium are also merely patterns passing through matter and energy.
Or think of yourself as a program in the biological computer that is your brain. The brain thinks and feels thoughts and emotions, and those thoughts and emotions are you.
How do you interact with the physical world? You sensory organs send signal to the sensory regions of you brain which interprets them as sensations. When you decide to do something, your brain sends signals to your body parts ordering actions.
So what is the Moriarty program? It is a computer program in one or more of the computers that make up the computer system of the Enterprise. When the Sherlock Holmes program is being run on the holodeck, the holodeck computer and program decide what sensory input the Moriarty program and send that information to the computer system running the Moriarty program. When the Moriarty program and its computer decide to do something they send signals to the computer running the Sherlock Holmes program on the holodeck to take that action.
Suppose you lean over a sink full of water and drop your glasses into it. You reach in with your arm and pick up the glasses and pull them out of the water. you are not in the sink full of water, you are inside your brain.
The Moriarty program was never in the holodeck, it was in a computer some distance away from the holodeck. The only things it could sense were events in the holodeck, and the only actions it could take were actions in the holodeck using its body made of holomatter, because that was the way it it was connected to the outside world.
There was no problem getting Moriarty out of the holodeck, because he wasn't in it. He was in the computers of the Enterprise, which were outside of the holodeck and not made of holomatter. The problem was enabling Moriarty to interact with matter and energy outside of the holodeck. The solution was to give Moriarty, a computer program in a computer system, much as you are a computer program in a computer system, sensory and command connections to a robot body made of normal matter existing outside of the holodeck.
I guess that the first body they would give to the Moriarty program might be like this.
The Death Star "mouse Droid" from Star Wars:
http://starwars.wikia.com/wiki/MSE-6-series_repair_droid
Then, if Moriarty behaved himself for a while, they might give him a larger body, like Dr. Theopolis in Buck Rogers:
http://buckrogers.wikia.com/wiki/Theopolis
And then if Moriarty continued to behave they could give him a body like Twiki in Buck Rogers:
http://buckrogers.wikia.com/wiki/Twiki
And then if Moriarty continued to behave they could give him a body like the remote controlled robot used by Nigel from England in the "ReplicANT" episode of A.N.T. Farm, or the remote controlled robot used by Liam in Bizaardvark.
And they might eventually have given Moriarty a Soong type android body resembling his holodeck image as Professor Moriarty (but probably with some visual differences to make it clear it was an android body) but without the positronic brain since it would continue to be remotely controlled by the Moriarty program in the Enterprise computer system. But I doubt that they would give that android body Data's strength.
So why didn't they do that a few weeks or months after "Elementary My Dear Data"? My guess is that a high ranking Starfleet Admiral was a big Sherlock Holmes fan and ordered them to cease and desist making a robot body for a computer program simulating and emulating Holmes's arch enemy!