Assumptions: No friction , massless string and pulley.
Q: Find constraint relation between 1kg and 2kg block.
what I tried so far
So, I used a method in which I consider the length of string. Length of red string is $2x_1$. Now , we can notice that one string is long joining 1kg and other joining the pulley is short. But since the assumptions are there. We can consider it like this. If you need a proof , then let me know. I shall give an example too in edit afterwards.
So , then length of string for 2nd pulley is $2x_p$.
I assume that the Length of string for $2kg $block is $2x_2$. However, I feel this is wrong since the same string is connected to 1kg block as well.
So, I get is $2x_1+2x_2+2x_p $but my answer is coming wrong.
So, it would be helpful if you can help me just correct where my mistake is or share another method if you’d like that.
another simpler example
Here , $a_1 , a_2 , a_3 $ are accelerations of $1kg , 2kg , 3kg $block respectively.