Let
x--------> The number of red marbles
y--------> The number of blue marbles
we know that
\(x+y=27\\ x=27-y\)
equation \(1\)
\(x=3y-5\)
equation \(2\)
equate equation \(1\) and equation \(2\)
\(27-y=3y-5\\ 3y+y=27+5\\ 4y=32\\ y=8\)
\(x=3*8-5\\ x=19\)
therefore
the answer is
The number of red marbles is \(19\)
The number of blue marbles is \(8\)