A medium ‘A’ is said to be optically denser then medium ‘B’, if the speed of light in ‘A’ is lesser than the speed of light in ‘B’ i.e the refractive index of ‘A’ is greater than the refractive index of ‘B’.
Light travels at different speeds in different mediums. The refractive index of a medium ‘A’ is given as the ratio of the velocity of light in vacuum to the velocity of light through the medium ‘A’.
First thing to note that there is no assignment operator in Elixir.
The ‘=’ operator is actually a match operator.
a = 1
Here the value as ‘a’ is bound to 1, as Elixir could find a way to make the…