Finding suspect coin

Problem statements:
I have 9 coins. One is bad coin (heavy or light). You need to find it.
You are allowed to use "weighing Balance" for three times.
S- Suspect
G- good
H- heavy
L- Light
== Compare

S S S S S S S S S

S S S==S S S
case 1
if Heavy light
H H L == X X X
{
If L easy answer
}
{ If H
H == H get the heavier
}
{
If same
H L == X X
If heavy H ,if light L is suspect If same suspect third L
}

CASE 1 This is similar to the above swap heavy and light

CASE 3 if same we have 6 good(G) and 3 bad(S)
compare G , G == S S
if L
S = S whichever is light
if H
S == S whichever is heavy
if SAME last one is suspect

Basically all are divided in 3 groups of 3 each

compare 2 groups and go forward.

This problem would have been much easier if we know that the suspect is Light or Heavy

But the problem gets interesting when we have more coins than 9. (Next blog will do with 12 coins)
There is an other problem : I have 9 coins
and know that one is bad and lighter.


Finding the suspect here is in two steps.
step1 ) make 3 groups 3,3,3

compare 3 , 3 ---

take suspicious(/lighter) 3 and divide into 1,1,1

compare 1,1 -- take the suspicious(/lighter) 1