To solve this problem, we need to set up a system of linear equations based on the given information. Let's define the variables:
- \( C \) for the number of children
- \( S \) for the number of students
- \( A \) for the number of adults
We have the following information:
- The total number of people is 139: \( C + S + A = 139 \)
- The total ticket sales amount to $1004: \( 5C + 7S + 12A = 1004 \)
- There are half as many adults as there are children: \( A = \frac{1}{2}C \)
We can use these equations to solve for \( C \), \( S \), and \( A \).
Let's define the variables for the number of children, students, and adults:
- Let \( c \) be the number of children.
- Let \( s \) be the number of students.
- Let \( a \) be the number of adults.
We are given three pieces of information that we can translate into equations:
- The total seating capacity is 139.
- The total ticket sales amount to \$1004.
- There are half as many adults as there are children.
From these, we can write the following equations:
- \( c + s + a = 139 \)
- \( 5c + 7s + 12a = 1004 \)
- \( a = \frac{1}{2}c \)
From the third equation, we have:
\[ a = \frac{1}{2}c \]
Substitute \( a \) into the first and second equations:
- \( c + s + \frac{1}{2}c = 139 \)
- \( 5c + 7s + 12 \left(\frac{1}{2}c\right) = 1004 \)
Simplify the first equation:
\[ c + s + \frac{1}{2}c = 139 \]
\[ \frac{3}{2}c + s = 139 \]
\[ 3c + 2s = 278 \quad \text{(Multiply by 2 to clear the fraction)} \]
Simplify the second equation:
\[ 5c + 7s + 6c = 1004 \]
\[ 11c + 7s = 1004 \]
We now have a system of two equations with two variables:
- \( 3c + 2s = 278 \)
- \( 11c + 7s = 1004 \)
We can use the method of elimination or substitution to solve this system. Let's use elimination.
Multiply the first equation by 7 and the second equation by 2 to align the coefficients of \( s \):
\[ 7(3c + 2s) = 7(278) \]
\[ 21c + 14s = 1946 \]
\[ 2(11c + 7s) = 2(1004) \]
\[ 22c + 14s = 2008 \]
Subtract the first modified equation from the second:
\[ (22c + 14s) - (21c + 14s) = 2008 - 1946 \]
\[ c = 62 \]
Substitute \( c = 62 \) back into the first simplified equation:
\[ 3(62) + 2s = 278 \]
\[ 186 + 2s = 278 \]
\[ 2s = 92 \]
\[ s = 46 \]
Now, use \( c = 62 \) to find \( a \):
\[ a = \frac{1}{2}c \]
\[ a = \frac{1}{2}(62) \]
\[ a = 31 \]
\[
\boxed{\text{62 children attended.}}
\]
\[
\boxed{\text{46 students attended.}}
\]
\[
\boxed{\text{31 adults attended.}}
\]