From fb72fe93c6bfa04c5abdd77dd9141948bd7bd802 Mon Sep 17 00:00:00 2001 From: Isaac Shoebottom Date: Sat, 16 Mar 2024 23:26:32 -0300 Subject: [PATCH] Whatever man --- .idea/.gitignore | 2 + .idea/deployment.xml | 21 +++ .idea/runConfigurations/Export_A3_No_Code.xml | 17 +++ .idea/runConfigurations/Export_A5_No_Code.xml | 17 +++ .idea/runConfigurations/Export_A6_No_Code.xml | 17 +++ Assignment 6.ipynb | 121 ++++++++++++++++++ 6 files changed, 195 insertions(+) create mode 100644 .idea/deployment.xml create mode 100644 .idea/runConfigurations/Export_A3_No_Code.xml create mode 100644 .idea/runConfigurations/Export_A5_No_Code.xml create mode 100644 .idea/runConfigurations/Export_A6_No_Code.xml create mode 100644 Assignment 6.ipynb diff --git a/.idea/.gitignore b/.idea/.gitignore index 13566b8..a9d7db9 100644 --- a/.idea/.gitignore +++ b/.idea/.gitignore @@ -6,3 +6,5 @@ # Datasource local storage ignored files /dataSources/ /dataSources.local.xml +# GitHub Copilot persisted chat sessions +/copilot/chatSessions diff --git a/.idea/deployment.xml b/.idea/deployment.xml new file mode 100644 index 0000000..7844128 --- /dev/null +++ b/.idea/deployment.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/Export_A3_No_Code.xml b/.idea/runConfigurations/Export_A3_No_Code.xml new file mode 100644 index 0000000..08902d3 --- /dev/null +++ b/.idea/runConfigurations/Export_A3_No_Code.xml @@ -0,0 +1,17 @@ + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/Export_A5_No_Code.xml b/.idea/runConfigurations/Export_A5_No_Code.xml new file mode 100644 index 0000000..ba04e01 --- /dev/null +++ b/.idea/runConfigurations/Export_A5_No_Code.xml @@ -0,0 +1,17 @@ + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/Export_A6_No_Code.xml b/.idea/runConfigurations/Export_A6_No_Code.xml new file mode 100644 index 0000000..431cdc3 --- /dev/null +++ b/.idea/runConfigurations/Export_A6_No_Code.xml @@ -0,0 +1,17 @@ + + + + \ No newline at end of file diff --git a/Assignment 6.ipynb b/Assignment 6.ipynb new file mode 100644 index 0000000..b64d226 --- /dev/null +++ b/Assignment 6.ipynb @@ -0,0 +1,121 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "a90ef9f8022df10e", + "metadata": { + "collapsed": false + }, + "source": [ + "# Question 36\n", + "## a.\n", + "For language B which is non-regular, for example:\n", + "$$B = \\{ w \\in \\{0, 1\\}^* | w \\text{ is a palindrome} \\}$$\n", + "\n", + "A is a subset of Language B:\n", + "$$A = \\{ab, aabb, aaabbb\\}$$\n", + "\n", + "A is however regular, as it is a finite language, so not all subsets of non-regular languages must also be non-regular\n", + "\n", + "## b.\n", + "For language B which is regular:\n", + "$$B = \\{ 0^n | n \\in \\mathbb{Z}\\}$$\n", + "\n", + "Then the following language is a subset of B, but is not regular:\n", + "$$A = \\{0^n | n \\text{ is prime}\\}$$\n", + "\n", + "As all primes are a subset of set $\\mathbb{Z}$" + ] + }, + { + "cell_type": "markdown", + "id": "2d1690ef", + "metadata": {}, + "source": [ + "$\\pagebreak$" + ] + }, + { + "cell_type": "markdown", + "id": "9a7c595f", + "metadata": {}, + "source": [ + "# Question 37\n", + "Let $p \\geq 1$ be any integer \\\n", + "Choose any string $s = a^{p}b^{p}c^{2p}$. $|s|$ is $4p$ which must be greater than $p$ \\\n", + "Consider any decomposition $s = xyz$ that satisfies 1. $|y| \\geq 1$ and 2. $|xy| \\leq p$\n", + "\n", + "Because of 2, x and y must be only \"a\", and because of 1, y must have at least one \"a\"\n", + "\n", + "So for the decomposition \"xyyz\", the number of \"a\" is p+1, and the number of \"b\" is p, which violates the condition that the number of \"c\" is 2p, as the the number of \"a\" plus the number of \"b\" is 2p+1" + ] + }, + { + "cell_type": "markdown", + "id": "c8d0ce5a", + "metadata": {}, + "source": [ + "$\\pagebreak$" + ] + }, + { + "cell_type": "markdown", + "id": "8d439d76", + "metadata": {}, + "source": [ + "# Question 38\n", + "Let $p \\geq 1$ be any integer \\\n", + "Choose any string $s = a^{p}b^{3p}$. $|s|$ is $4p$ which must be greater than $p$ \\\n", + "Consider any decomposition $s = xyz$ that satisfies 1. $|y| \\geq 1$ and 2. $|xy| \\leq p$\n", + "\n", + "Because of 2, x and y must be only \"a\", and because of 1, y must have at least one \"a\"\n", + "\n", + "So for the decomposition \"xyyz\", the number of \"a\" is p+1, and the number of \"b\" is 3p, which contradicts the premise that $n_a(w) = 3n_b(w)$ as for any integers which satisfy this condtion, the $n_a(w)$ will always be 1 more than required" + ] + }, + { + "cell_type": "markdown", + "id": "323bea35", + "metadata": {}, + "source": [ + "$\\pagebreak$" + ] + }, + { + "cell_type": "markdown", + "id": "56466c7f", + "metadata": {}, + "source": [ + "# Question 41\n", + "Let $p \\geq 1$ be any integer \\\n", + "Choose any string $s = a^{p}b^{p}$. $|s|$ is $2p$ which must be greater than $p$ \\\n", + "Consider any decomposition $s = xyz$ that satisfies 1. $|y| \\geq 1$ and 2. $|xy| \\leq p$\n", + "\n", + "Because of 2, x and y must be only \"a\", and because of 1, y must have at least one \"a\"\n", + "\n", + "So for the decomposition \"xz\", the number of \"a\" is p-1, which contradicts the condition that $|x| \\geq p$" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}