Answer:
If there is 1 hour of production:
Cars produced by Japan = 5/8 = .625 cars
HD TV produced by Japan = 15/10 = 1.5 HD TVs
Further,
Cars produced by US = 5/6 = .83 cars
HD TV produced by US = 15/5 = 3 HD TVs
So,
Opportunity cost of a car for Japan = 1.5/.625 = 2.4 units of HD TVs
Opportunity cost of car for US = 3/.83 = 3.61 units of HD TV
Since, Japan has lower opportunity cost of producing cars, so Japan has comparative advantage in producing cars.
Opportunity cost of a HD TV for Japan = .625/1.5 = .42 units of car
Opportunity cost of a HD TV for US = .83/3 = .28 units of car
Since US has lower opportunity cost of producing HD TVs, so US has comparative advantage in producing HD TVs.