Case 1
Let the cost of the pencil be- x
Let the cost of the pen be- y
Total cost- Rs.33
(Eq. 1.) 2x+3y=33
Case 2
Total cost= Rs.27
(Eq. 2.) 3x+2y=27
Therefore, from eq. 1 and 2,
2x+3y=33
3x+2y=27
By using elimination method
Multiply eq. 1 from 3 and eq. 2 from 2
6x+9y=99………. (Eq. 3)
6x+4y=54……….(Eq. 4)
By solving eq. 3 and 4, we get,
5y=45
y=9
By substituting the value of y in eq. 1
2x+3*9=33
2x+27=33
2x=6
x=3
Therefore, x=3 and y=9