A superconductor is a substance that is able to conduct electricity without resistance

Question: A superconductor is a substance that is able to conduct electricity without resistance, a property that is very desirable in the construction of large electromagnets. Metals have this property if cooled to temperatures a few degrees above absolute zero, but this requires the use of expensive liquid helium (boiling point 4 K). Scientists have discovered materials that become superconductors at higher temperatures, but they are ceramics. Their brittle nature has so far prevented them from being made into long wires. A recently discovered compound of magnesium and boron, which consists of 52.9% Mg and 47.1% B, shows special promise as a high-temperature superconductor because it is inexpensive to make and can be fabricated into wire relatively easily. What is the formula of this compound?

Solution:

Let us take 100 g of compound
Then, mass of Mg = 52.9g
and mass of boron = 47.1g
Moles of Mg = Mass/Molar Mass = 52.9g/24.31g/mol
= 2.18 mol
and moles of B = 47.1g/10.81g/mol
= 4.36 mol
So, the molar ratio of Mg and B:
nMg/nB = 2.18 mol/4.36 mol = 1/2
Formula of the compound is MgB2