In 1947 , West Pakistan and East Bengal ( both primarily Muslim ) separated from India ( largely Hindu ) and jointly became the new country of Pakistan .