"If one of you comes to our tree, then our population will be double that of yours."
So [tex]A+1 =2\times (B-1)
A+1 = 2B - 2[/tex]
"If one of you comes here, then our population will be equal to that of yours."
[tex]A-1 = B+1[/tex]
Rearranging these to make A the subject gives:
[tex]A = 2B-3[/tex]
[tex]A = B +2[/tex]
Then solve for B:
[tex]2B - 3 = B + 2
B = 5[/tex]
Substitute B back in to an equation:
[tex]A = B + 2
A = 5 + 2
A = 7[/tex]
So there are seven birds in A, and 5 birds in B