<jupyter_start><jupyter_text>Mathematical logic> Mathematical logic is a subfield of mathematics exploring the applications of formal logic to mathematics. It bears close connections to metamathematics, the foundations of mathematics, and theoretical computer science.The unifying themes in mathematical logic include the study of the expressive power of formal systems and the deductive power of formal proof systems (https://en.wikipedia.org/wiki/Mathematical_logic).The main goal of this challenge is not going deeply into the Mathematical logic concepts but, instead, provide some mathematical challenges that you can resolve applying some logical approach!Consider the follow problem:$A + B = 72$$B + C = 36$$A + C = 32$$C = ?$What is the value of `C`?Normally, we think about that as a [System of linear equations](https://en.wikipedia.org/wiki/System_of_linear_equations),lets give a try:Assumptions:$A + B = 72$$B + C = 36$$A + C = 32$Resolution:$B + C = A + C + 4$$B - A = 4$$B - (72 - B) = 0 + 4$$2B - 72 = 0 + 4$$B = (4 + 72) / 2$$B = 38$So, lets resolve `A`: $A + B = 72$$A = 72 - 38$$A = 34$And now, we can resolve C:$B + C = 36$$38 + C = 36$$C = 36 - 38$$C = -2$We can also check with the `A + C` equation:$A + C = 32$$34 + (-2) = 32$$32 = 32$If you understand all the (simple) math here, good job! If not, no problem, try again to resolve that by your own!But maybe you are asking if there is a better (faster) way to resolve that, and, of course, there it is!Sometimes using mathematical logic you can `cut` some steps and find a faster way to resolve a problem.So consider the previous problem, what new assumptions we can do?1) $A + B = 72$2) $B + C = 36$3) $A + C = 32$So, what if we combine all the three equations?$B + C + A + C - (A + B) = 36 + 32 - 72$Changing the ordering here, we have:$A - A + B - B + 2C = 36 + 32 - 72$$2C = - 4$$C = -4 / 2$$C = -2$And voilà! It looks faster then before, right?The following code does the same as we did right above (a little bit more simplified):<jupyter_code>AB = 72
BC = 36
AC = 32

C = (BC + AC - AB) // 2
C<jupyter_output><empty_output><jupyter_text>And you can check all the equations using the following code:<jupyter_code>B = 36 - C
A = 32 - C
assert A + B == AB
assert B + C == BC
assert A + C == AC<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11700739451935624, 'fraction_numerical': 0.04219225750326229, 'mean_word_length': 3.9145299145299144, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 10, 'https://': 2, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '528700', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 815, 'n_tokens_neox': 711, 'n_words': 337, 'path': 'challenge-4-mathematical-logic.ipynb', 'repo_name': 'xmnlab/challenges', 'size': '2299'}