<jupyter_start><jupyter_text>Problem 2-99 of Capter 02<jupyter_code>from pandas import DataFrame
disks = DataFrame({'High': [70, 16], 'Low': [9, 5]}, index =  ['High', 'Low'])
disks
disks.columns.name = 'Shock Resistance'
disks.index.name = 'Scratch Resistence'
disks # The data given in the problem is the table as follow:
# A denote the event that the disk has high shock resistence
nA = disks.sum().High
nA
# B denote the event that the disk has high scratch resistence
nB = disks.sum(axis = 1).High
nB
# U denote the universe
nU = disks.sum().sum()
nU
# item a. P(A)
P_A = nA / nU
P_A
# item b. P(B)
P_B = nB / nU
P_B
# item c. P(A/B) = P(A^B) / P(B)
P_AgivenB = disks.High.High / nU / P_B
P_AgivenB
# item d. P(B/A) = P(A^B) / P(A)
P_BgivenA = disks.High.High / nU / P_A
P_BgivenA<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14355828220858896, 'fraction_numerical': 0.014723926380368098, 'mean_word_length': 3.8862275449101795, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '631666', 'license': 'MIT', 'n_tokens_mistral': 365, 'n_tokens_neox': 345, 'n_words': 107, 'path': 'Cap02/P-2_99.ipynb', 'repo_name': 'IsraelBOrrico/montgomery_resolucao_python', 'size': '815'}