Whatever man
This commit is contained in:
parent
0d76b15bbb
commit
fb72fe93c6
2
.idea/.gitignore
vendored
2
.idea/.gitignore
vendored
@ -6,3 +6,5 @@
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
# GitHub Copilot persisted chat sessions
|
||||
/copilot/chatSessions
|
||||
|
21
.idea/deployment.xml
Normal file
21
.idea/deployment.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="PublishConfigData" remoteFilesAllowedToDisappearOnAutoupload="false">
|
||||
<serverData>
|
||||
<paths name="ishoebot@cs3103:22 agent">
|
||||
<serverdata>
|
||||
<mappings>
|
||||
<mapping local="$PROJECT_DIR$" web="/" />
|
||||
</mappings>
|
||||
</serverdata>
|
||||
</paths>
|
||||
<paths name="ishoebot@cs3103:22 agent (2)">
|
||||
<serverdata>
|
||||
<mappings>
|
||||
<mapping local="$PROJECT_DIR$" web="/" />
|
||||
</mappings>
|
||||
</serverdata>
|
||||
</paths>
|
||||
</serverData>
|
||||
</component>
|
||||
</project>
|
17
.idea/runConfigurations/Export_A3_No_Code.xml
Normal file
17
.idea/runConfigurations/Export_A3_No_Code.xml
Normal file
@ -0,0 +1,17 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Export A3 No Code" type="ShConfigurationType">
|
||||
<option name="SCRIPT_TEXT" value="jupyter-nbconvert.exe "Assignment 3.ipynb" --to pdf --no-input" />
|
||||
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
|
||||
<option name="SCRIPT_PATH" value="" />
|
||||
<option name="SCRIPT_OPTIONS" value="" />
|
||||
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
|
||||
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
|
||||
<option name="INTERPRETER_PATH" value="powershell.exe" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="EXECUTE_IN_TERMINAL" value="false" />
|
||||
<option name="EXECUTE_SCRIPT_FILE" value="false" />
|
||||
<envs />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
17
.idea/runConfigurations/Export_A5_No_Code.xml
Normal file
17
.idea/runConfigurations/Export_A5_No_Code.xml
Normal file
@ -0,0 +1,17 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Export A5 No Code" type="ShConfigurationType">
|
||||
<option name="SCRIPT_TEXT" value="jupyter-nbconvert.exe "Assignment 5.ipynb" --to pdf --no-input" />
|
||||
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
|
||||
<option name="SCRIPT_PATH" value="" />
|
||||
<option name="SCRIPT_OPTIONS" value="" />
|
||||
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
|
||||
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
|
||||
<option name="INTERPRETER_PATH" value="powershell.exe" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="EXECUTE_IN_TERMINAL" value="false" />
|
||||
<option name="EXECUTE_SCRIPT_FILE" value="false" />
|
||||
<envs />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
17
.idea/runConfigurations/Export_A6_No_Code.xml
Normal file
17
.idea/runConfigurations/Export_A6_No_Code.xml
Normal file
@ -0,0 +1,17 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Export A6 No Code" type="ShConfigurationType">
|
||||
<option name="SCRIPT_TEXT" value="jupyter-nbconvert.exe "Assignment 6.ipynb" --to pdf --no-input" />
|
||||
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
|
||||
<option name="SCRIPT_PATH" value="" />
|
||||
<option name="SCRIPT_OPTIONS" value="" />
|
||||
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
|
||||
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
|
||||
<option name="INTERPRETER_PATH" value="powershell.exe" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="EXECUTE_IN_TERMINAL" value="false" />
|
||||
<option name="EXECUTE_SCRIPT_FILE" value="false" />
|
||||
<envs />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
121
Assignment 6.ipynb
Normal file
121
Assignment 6.ipynb
Normal file
@ -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
|
||||
}
|
Loading…
Reference in New Issue
Block a user