Include elementary note

This commit is contained in:
Saul Sylvester 2023-11-18 12:45:54 +00:00
parent 15dadc8779
commit dd4805d3d1
3 changed files with 156 additions and 0 deletions

View File

@ -0,0 +1,6 @@
{
"cells": [],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 5
}

View File

@ -0,0 +1,149 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "341a4908-1f73-45ab-a814-4d60f7be94a3",
"metadata": {},
"source": [
"## “Both Gauss and lesser mathematicians may be justified in rejoicing that there is one science at any rate, and that their own, whose very remoteness from ordinary human activities should keep it clean and gentle.” - G.H. Hardy\n",
"\n",
"The Well-Ordering Principle (WOP) is a fundamental principle in mathematics that states that every set of natural numbers (positive integers) can be arranged in a specific order, called a well-ordering, such that every non-empty subset has a smallest element. In other words, for any set of natural numbers, no matter how large or small, there will always be a smallest number in that set.\n",
"\n",
"`Statement: The sum of the first n natural numbers is equal to n(n+1)/2.`"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "0b2ce170-e608-4e78-94c3-c07825407ce7",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"87"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from random import randint\n",
"n = randint(1,100)\n",
"n"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "4781e6f5-6c67-41bb-8c0d-c17453ae0064",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"3828"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"sum(range(1,n+1))"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "a7f4163f-b2c0-4289-b4f5-d5d5598982ee",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"3828.0"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"n * (n+1)/2"
]
},
{
"cell_type": "markdown",
"id": "886c3a29-932a-4a59-a56f-5ff22729f987",
"metadata": {},
"source": [
"`Archimedean property. If a and b are any positive integers, then\n",
"there exists a positive integer n such that na ≥ b.`"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "79cb12f9-7eaf-4b38-b84b-f3695d6cc186",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"True\n"
]
}
],
"source": [
"def archimedean_property(a, b):\n",
" if a == 0:\n",
" return False\n",
" if b == 0:\n",
" return True\n",
"\n",
" n = 1\n",
" while b > n * a:\n",
" n += 1\n",
"\n",
" return True\n",
"\n",
"print(archimedean_property(3, 7))"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "eb4e7fcd-61cc-4d36-a7bd-5de4dc33a313",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
}
},
"nbformat": 4,
"nbformat_minor": 5
}

View File

@ -0,0 +1 @@
# Notes on Elementary Number Theory