document.write( "Question 841138: A group consists of 6 students (3 boys and 3 girls) and one teacher. In how many ways can the 7 people sit in a row if boys cannot sit together and girls cannot sit together? \n" ); document.write( "
Algebra.Com's Answer #507007 by Edwin McCravy(20055)\"\" \"About 
You can put this solution on YOUR website!
A group consists of 6 students (3 boys and 3 girls) and one teacher. In how many ways can the 7 people sit in a row if boys cannot sit together and girls cannot sit together?
\n" ); document.write( "
\r\n" );
document.write( "If the teacher sits 1st or 7th, then the possible seating arrangements\r\n" );
document.write( "of students by sex are TBGBGBG or TGBGBGB or their reversals.  \r\n" );
document.write( "That's 4 arrangements by sex\r\n" );
document.write( "\r\n" );
document.write( "If the teacher sits 2nd or 6th, then the possible seating arrangements\r\n" );
document.write( "of students by sex are BTGBGBG, GTBGBGB, and their reversals. \r\n" );
document.write( "That's 4 arrangements by sex\r\n" );
document.write( "\r\n" );
document.write( "If the teacher sits 3rd or 5th, then the possible seating arrangements\r\n" );
document.write( "of students by sex are BGTBGBG, GBTBGBG, BGTGBGB or GBTGBGB and their reversals. That's 8 arrangements by sex\r\n" );
document.write( "\r\n" );
document.write( "If the teacher sits 4th, then the possible seating arrangements of students\r\n" );
document.write( "by sex are BGBTGBG and its reversal. That's 2 arrangements by sex,\r\n" );
document.write( "\r\n" );
document.write( "That's 4+4+8+2=18 arrangements by sex.\r\n" );
document.write( "\r\n" );
document.write( "For each of those 18 arrangements by sex, there are 3! ways to arrange\r\n" );
document.write( "the girls and 3! ways to arrange the boys,\r\n" );
document.write( "\r\n" );
document.write( "Answer 18·3!·3! = 18·6·6 = 648 ways.\r\n" );
document.write( "\r\n" );
document.write( "Edwin
\n" ); document.write( "
\n" );