The compound formula can be determined from the charge of the constituent elements of the compound
Further explanation
There are several compounds :
ion compounds, covalent compounds, and polyatomic
For ionic compounds consisting of cations (ions +) and anions (ions -)
The naming is preceded by the cation then the anion with the -ide suffix added
Generally for this ion compound consists of metal elements as cations and non-metals as anions
1. Mg²⁺, Br⁻
2. no, +2(Mg) + -1(Br)=+2-1=+1
3. Mg²⁺ 1 ion, Br⁻ need 2 ion
4. MgBr₂, 1 Mg and 2 Br
1. Zn²⁺, P³⁻
2. no, +2(Zn)+ -3(P)=2-3=-1
3. Zn need 3 ion, P 2 ion
4. Zn₃P₂, 3 Zn and 2 P