Imani wrote a program that switches digits in numbers. Users enter a \(4\)-digit number and then use the following buttons to switch digits in the number:
Button | Function |
---|---|
switches the thousands and tens digits | |
switches the hundreds and units (ones) digits | |
switches the thousands and units (ones) digits |
Imani enters the last four digits of her phone number, then presses the following sequence of buttons, in order from left to right.
The number now shown is \(2148\).
Then, Imani restarts the program, enters the last four digits of her phone number again, and presses the following sequence of buttons, in order from left to right.
What number is now shown?
First we need to determine the last four digits of Imani’s phone number, as this is the number she entered into the program. We can determine this by working backwards starting with \(2148\), which is the number shown after all the buttons were pressed. We will then go through the buttons one by one, from last to first.
To obtain \(2148\), the number
must have been \(8142\) before pressing
.
Then, the number must have been \(4182\) before pressing .
Then, the number must have been \(4281\) before pressing .
Then, the number must have been \(1284\) before pressing .
Then, the number must have been \(8214\) before pressing .
Thus, the last four digits of Imani’s phone number are \(8214\).
Now we can determine the number shown after Imani entered \(8214\) and pressed the second sequence of buttons.
The number will be \(8412\)
after pressing .
Then, the number will be \(2418\) after pressing .
Then, the number will be \(1428\) after pressing .
Then, the number will be \(1824\) after pressing .
Thus, the number \(1824\) is now shown.