The original question can be found at the following source: Berkeley PDF, Page 2, Question 1.
Validity test:
$\bullet$ Sequence $_{\text {response }}>=5001$
$\bullet$ (Sequence $_{\text {response }}+$ Payload $\left._{\text {response }}\right) \leq \left(\right.$ Acknowledgement $_{\text {first }}+$ Window size $\left._{\text {first }}\right)=(5001+$ 3000) $=8001$
The source of the Validity test is Berkeley PDF, Page 8,
A may send any packet with sequence number ranging from $5001$ to $8000$.
Now, let's understand the question again. B is saying, "I need data from 5001 and can hold till 8000," so why will A ever send from 6001 and not 5001? Why is A not sending from 5001? The reason must be that A has already sent from 5001 to 6000.
Consider the case – B asks for data from 5001, and the window size at B is, suppose, just 1000. So, B just sent an ACK, saying that the ACK number is 5001, and the Window size is 1000. Immediately after that, B realizes that the window has more space because the application layer has consumed more data. So, what will B do? Will B wait for data from 5001 to 6000 and then announce that the window has increased and can accommodate more data, or will B announce immediately? Obviously, there is no point in waiting for the data and then announcing; hence, B will send a SECOND ACK and will announce immediately, saying, "ACK number is 5001, and Window size is 3000." In the question, the ACK sent by B is the SECOND ACK.
Now, A will receive 2 ACKs back-to-back. The moment it receives the first ACK, it will send data from 5000 to 6000. However, upon receiving the SECOND ACK from B, it will realize that B's window is even larger. Let me send data from 6001. So, A receives the (SECOND) ACK, which requests data from 5001 to 8000, and is still sending data from 6001.