## Symbolic Representation

The problem can be converted into a symbolic representation as follows:

* Let $x_1$ be the number of social media commercials
* Let $x_2$ be the number of television commercials

The objective is to minimize the total cost, which is $30,000x_1 + 50,000x_2$.

The constraints are:
* The number of young girls seeing the commercials should be at least 20 million: $5x_1 + 3x_2 \geq 20$
* The number of middle-aged women seeing the commercials should be at least 30 million: $x_1 + 7x_2 \geq 30$
* The number of commercials should be non-negative: $x_1 \geq 0, x_2 \geq 0$

## Symbolic Representation in JSON Format

```json
{
    'sym_variables': [('x1', 'social media commercials'), ('x2', 'television commercials')],
    'objective_function': '30000*x1 + 50000*x2',
    'constraints': ['5*x1 + 3*x2 >= 20', 'x1 + 7*x2 >= 30', 'x1 >= 0', 'x2 >= 0']
}
```

## Gurobi Code

```python
import gurobipy as gp

# Create a new model
model = gp.Model("cosmetics_company")

# Define the variables
x1 = model.addVar(name="social_media_commercials", lb=0, vtype=gp.GRB.INTEGER)
x2 = model.addVar(name="television_commercials", lb=0, vtype=gp.GRB.INTEGER)

# Define the objective function
model.setObjective(30000*x1 + 50000*x2, gp.GRB.MINIMIZE)

# Define the constraints
model.addConstr(5*x1 + 3*x2 >= 20, name="young_girls_constraint")
model.addConstr(x1 + 7*x2 >= 30, name="middle_aged_women_constraint")

# Solve the model
model.optimize()

# Print the solution
if model.status == gp.GRB.OPTIMAL:
    print("Optimal solution found.")
    print(f"Number of social media commercials: {x1.varValue}")
    print(f"Number of television commercials: {x2.varValue}")
    print(f"Total cost: {model.objVal}")
else:
    print("No optimal solution found.")
```