Given :- A switch with $8$ ports and we require to connect $15$ machines together.
Using $1$ switch we can connect only $8$ machines together.
Using $2$ switches we can connect only $14$ machines together.
Using $3$ switches we can connect $20$ machines together.
$\therefore$ We require atleast $3$ switches to connect $15$ machines together.