[tex]\huge\boxed{22:7}\ \huge\boxed{29:22}[/tex]
First, we need to find the number of yellow pencils in the basket. We'll represent the number of green pencils with [tex]g[/tex] and the number of yellow pencils with [tex]y[/tex].
[tex]\begin{aligned}7+y&=29&&\smash{\Big|}&&\text{Start with what we already know.}\\y&=22&&\smash{\Big|}&&\text{Subtract 7 from both sides.}\end{aligned}[/tex]
Our first ratio is [tex]y:g[/tex], or [tex]\boxed{22:7}[/tex].
The second ratio is [tex](g+y):y[/tex]:
[tex]\begin{aligned}(g+y)&:y\\(7+22)&:22\\29&:22\end{aligned}[/tex]