Write a computer program to simulate the Monty Hall problem and calculate the probability of winning when switching doors.
Here's a Python program to simulate the Monty Hall problem and calculate the probability of winning when switching doors:

```python
import random

def monty_hall_simulator(switch, num_trials=1000):
    win_count = 0

    for _ in range(num_trials):
        # Randomly place the car behind one of the three doors
        car_door = random.randint(1, 3)

        # Contestant chooses a door randomly
        chosen_door = random.randint(1, 3)

        # Monty opens a door that has a goat behind it and is not the chosen door
        available_doors = [door for door in [1, 2, 3] if door != chosen_door and door != car_door]
        opened_door = random.choice(available_doors)

        # If the contestant decides to switch doors
        if switch:
            remaining_doors = [door for door in [1, 2, 3] if door != chosen_door and door != opened_door]
            chosen_door = remaining_doors[0]

        # Check if the contestant wins (chosen door has the car)
        if chosen_door == car_door:
            win_count += 1

    return win_count / num_trials

# Run the simulation with switching strategy
num_trials = 100000
win_probability_switching = monty_hall_simulator(True, num_trials)
print(f"Winning probability when switching doors: {win_probability_switching:.4f}")
```

This program defines a function `monty_hall_simulator` which takes two arguments - whether the contestant switches doors (`switch`) and the number of trials to run (`num_trials`). The function simulates the Monty Hall problem `num_trials` times and returns the proportion of wins.

The main part of the code runs the simulation with the switching strategy and prints the winning probability. You can adjust the `num_trials` variable to increase or decrease the number of trials for better accuracy.