Why is it that a computer monitor or a TV screen can produce millions of colors using only the 3 primary additive colors?

Likewise, how can a printer print millions of color using only the colors of magenta, cyan, and yellow?

How are the primary additive and the primary subtractive colors related?

This has little to do with physics. THe colors don't really add, but the brain senses a new color. The (human) eye consists of three types of cones, each sensitive to a different color range. When colored light strikes the eye cones, the sensations sent to the brain gives sensations of a combination of color, which the brain registers as a "single" color. Differences in how the eye cones react to different colors also accounts for some color "blindness", and why some humans see some colors differently. So you question is really a biological one, asking how humans are different from other animals, how human eye cones vary from person to person, and how the brain classifies information (and interprets it).

http://en.wikipedia.org/wiki/Primary_color

A computer monitor or a TV screen can produce millions of colors using only the three primary additive colors (red, green, and blue) through a process called additive color mixing.

In additive color mixing, different intensities of red, green, and blue light are combined in varying proportions to create a wide range of colors. By varying the intensity of each primary color, the screen can produce different shades and hues. The combination of red, green, and blue at their maximum intensity produces white, while the absence of all colors (zero intensity) results in black.

On the other hand, a printer can print millions of colors using only the colors of magenta, cyan, and yellow through a process called subtractive color mixing.

In subtractive color mixing, pigments or dyes are used instead of emitted light. The primary subtractive colors are magenta, cyan, and yellow. When these pigments are mixed together, they absorb or subtract certain wavelengths of light, resulting in different colors. For example, when cyan and magenta pigments are mixed, they absorb green light, resulting in the perception of blue.

In subtractive color mixing, the combination of all three primary colors (magenta, cyan, and yellow) at full intensity results in black, while the absence of all colors (no ink) results in white.

The primary additive and subtractive colors are related through their complementary colors. The complementary colors of additive color mixing are the primary colors of subtractive color mixing, and vice versa.

For additive colors, the complementary colors are the ones that, when combined, produce white. For example, the complementary color of blue (additive primary) is yellow (subtractive primary). So, on a monitor, if red and green light are combined, yellow light is perceived.

For subtractive colors, the complementary colors are the ones that, when combined, absorb or subtract all colors, resulting in black. For example, the complementary color of magenta (subtractive primary) is green (additive primary). So, when magenta and green pigments are mixed, they absorb all colors, resulting in black.

Overall, the primary additive and subtractive colors are interconnected and can be combined or mixed to produce a wide variety of colors.