## Problem Description and Formulation

The problem is a linear programming optimization problem. The goal is to maximize the profit from selling two types of tickets: premium and regular. The attraction sells a total of 500 tickets, with at least 100 being premium tickets. Additionally, at least 3 times as many people prefer regular tickets than premium tickets.

## Decision Variables

Let \(P\) be the number of premium tickets sold, and \(R\) be the number of regular tickets sold.

## Objective Function

The profit per premium ticket is $50, and the profit per regular ticket is $30. The objective is to maximize the total profit:

\[ \text{Maximize:} \quad 50P + 30R \]

## Constraints

1. Total tickets sold is 500:
\[ P + R \leq 500 \]

2. At least 100 tickets are premium:
\[ P \geq 100 \]

3. At least 3 times as many people prefer regular tickets than premium tickets:
\[ R \geq 3P \]

4. Non-negativity constraints:
\[ P \geq 0, R \geq 0 \]

Since \(P\) and \(R\) represent the number of tickets, they must be integers. However, for the purpose of this linear programming formulation, we will first solve it without explicitly enforcing integer solutions, and then consider how to adjust for integer solutions if necessary.

## Gurobi Code

```python
import gurobi

def solve_tickets():
    # Create a new model
    m = gurobi.Model()

    # Define the decision variables
    P = m.addVar(lb=0, name="Premium_Tickets")
    R = m.addVar(lb=0, name="Regular_Tickets")

    # Objective function: Maximize profit
    m.setObjective(50*P + 30*R, gurobi.GRB.MAXIMIZE)

    # Constraints
    m.addConstr(P + R <= 500, name="Total_Tickets")
    m.addConstr(P >= 100, name="Premium_Tickets_Min")
    m.addConstr(R >= 3*P, name="Regular_vs_Premium")

    # Solve the model
    m.optimize()

    if m.status == gurobi.GRB.Status.OPTIMAL:
        print(f"Optimal Solution: Premium Tickets = {P.varValue}, Regular Tickets = {R.varValue}")
        print(f"Maximum Profit: ${50*P.varValue + 30*R.varValue}")
    else:
        print("No optimal solution found.")

solve_tickets()
```

This code sets up the optimization problem as described, using Gurobi to find the optimal number of premium and regular tickets to sell in order to maximize profit, subject to the given constraints. Note that Gurobi's `addVar` method automatically treats variables as continuous. If integer solutions are required, you would need to specify `vtype='I'` in the `addVar` method for both `P` and `R`. However, given the nature of this problem (dealing with tickets that must be whole), adjusting for integer solutions is implicitly considered in the formulation. 

To enforce integer solutions explicitly:

```python
P = m.addVar(lb=0, vtype=gurobi.GRB.INTEGER, name="Premium_Tickets")
R = m.addVar(lb=0, vtype=gurobi.GRB.INTEGER, name="Regular_Tickets")
```