In LAN all the machines are interconnected. If we use a switch for 8 machines, and another for 7 machines; the first 8 machines won't be connected to the latter 7. So using two switches won't be enough.
In the first switch A,
- First 7 ports — 7 machines.
- Last port — Connect to other switch B.
In the second switch B
- One port already connected to A
- 6 ports — 6 machines
- Last port — Connect to other switch C.
In the third switch C
- One port already connected to B
- 2 ports — 2 machines.
Done! We need 3 switches.
Alternatively.
Machines to be connected = 15.
Ports available per switch = 7 (NOT 8)
So, 15/7 = 2.142 => 3 switches are required.