Question 4
John wrote a 4-digit number on a paper and asked Peter to guess it. Peter asked: “Is the number 8921?” John replied: “Three digits are correct. The positions of those digits are also correct.” Peter asked again: “Is the number 4782?” John replied: “Two digits are correct, but the positions of those digits are both wrong.” Peter asked again: “Is the number 3501?” John said: “Two digits are correct. The positions of those digits are also correct.” What is the number written by John?