Solution

161124

First name
NS
School
TCS
Age
0

probability is 24/42
Even though colors are interchangeable, lets work with numbering the ball 1 to 7.
there are 7! combinations.
Lets number the spots by row 1,2 /3,4,5/ 6, 7
Lets put Blue-1 Ball in 1 spot. There are 3 adjacent spots where Blue-2 can be in order to be touching. Same for all the spots except spot 4 which is center.

For each of the outer spots, total permutations possible are 1*3*5!
Total for out spot s= 6*3*5!
For the center spot = 1*6*5!

sum = 8*3*5!
Prob = 8*3*5! /7!
= 24/42