Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Виклик: Розв’язання задачі за допомогою геометричної ймовірності | Базові Поняття Теорії Ймовірностей
Основи Теорії Ймовірностей

book
Виклик: Розв’язання задачі за допомогою геометричної ймовірності

Розгляньте квадрат зі стороною довжиною 2 одиниці, центрований у початку координат (0, 0) у декартовій системі координат.
Яка ймовірність того, що випадково обрана точка всередині квадрата не потрапить у коло з радіусом 1 одиниця, центроване у початку координат?
Оскільки маємо двовимірний простір елементарних подій, можемо обчислити відношення площі кола до площі квадрата. Це відношення визначає ймовірність того, що точка потрапить у коло.

Завдання

Swipe to start coding

Обчисліть ймовірність як відношення площі синьої області до всієї площі квадрата.

Рішення

import numpy as np
import matplotlib.pyplot as plt

# Define the radius of the circle and the side length of the square
radius = 1
side_length = 2

# Calculate the area of the circle and the square
circle_area = np.pi * radius**2
square_area = side_length**2

# Calculate the probability that point doesn't fall into a circle
probability = (square_area - circle_area) / square_area

# Print the solution
print(f'The probability that a randomly chosen point within the square do not fall into a circle is {probability:.4f}')
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 4
single

single

import numpy as np
import matplotlib.pyplot as plt

# Define the radius of the circle and the side length of the square
radius = 1
side_length = 2

# Calculate the area of the circle and the square
circle_area = np.pi * radius**2
square_area = side_length**2

# Calculate the probability that point doesn't fall into a circle
probability = (___ - ___) / square_area

# Print the solution
print(f'The probability that a randomly chosen point within the square do not fall into a circle is {probability:.4f}')

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

some-alt