The number of subnets and hosts in an IP address can be calculated using powers of 2. The example IP addresses are 10.1.1.0/24, 192.168.11.0/26, and 172.16.55.0/21. Calculations include 2 to the power of subnet bits for number of subnets and 2 to the power of host bits minus 2 for number of hosts per subnet. The calculations are performed for each IP address, resulting in maximum numbers of subnets and hosts.