Compare commits
20 Commits
20fdb9413d
...
master
Author | SHA1 | Date | |
---|---|---|---|
7c80576cc4 | |||
a8c763010a | |||
fb72fe93c6 | |||
0d76b15bbb | |||
fb6c21adcb | |||
54c399dcb3 | |||
816c195ca9 | |||
8ebf6af159 | |||
1a3a9140a7 | |||
3f82e236d6 | |||
95e4b72316 | |||
d4f41fbd44 | |||
1e91ba5ba6 | |||
0b83fe9bfb | |||
487859e9d6 | |||
9990c0e8a1 | |||
bf7f83f9cb | |||
bae7ee7cd1 | |||
cec9e9104f | |||
fd4359943e |
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
.ipynb_checkpoints
|
.ipynb_checkpoints
|
||||||
*.pdf
|
*.pdf
|
||||||
|
__pycache__
|
2
.idea/.gitignore
generated
vendored
2
.idea/.gitignore
generated
vendored
@ -6,3 +6,5 @@
|
|||||||
# Datasource local storage ignored files
|
# Datasource local storage ignored files
|
||||||
/dataSources/
|
/dataSources/
|
||||||
/dataSources.local.xml
|
/dataSources.local.xml
|
||||||
|
# GitHub Copilot persisted chat sessions
|
||||||
|
/copilot/chatSessions
|
||||||
|
6
.idea/CS2333.iml
generated
6
.idea/CS2333.iml
generated
@ -5,7 +5,11 @@
|
|||||||
<excludeFolder url="file://$MODULE_DIR$/.idea" />
|
<excludeFolder url="file://$MODULE_DIR$/.idea" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/.ipynb_checkpoints" />
|
<excludeFolder url="file://$MODULE_DIR$/.ipynb_checkpoints" />
|
||||||
</content>
|
</content>
|
||||||
<orderEntry type="jdk" jdkName="Python 3.11 (jupyter)" jdkType="Python SDK" />
|
<orderEntry type="jdk" jdkName="Python 3.9.18 WSL (RockyLinux): (/home/isaac/.virtualenvs/CS2333/bin/python)" jdkType="Python SDK" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
</component>
|
</component>
|
||||||
|
<component name="PackageRequirementsSettings">
|
||||||
|
<option name="removeUnused" value="true" />
|
||||||
|
<option name="keepMatchingSpecifier" value="false" />
|
||||||
|
</component>
|
||||||
</module>
|
</module>
|
21
.idea/deployment.xml
generated
Normal file
21
.idea/deployment.xml
generated
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>
|
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@ -7,5 +7,5 @@
|
|||||||
<option name="show" value="ASK" />
|
<option name="show" value="ASK" />
|
||||||
<option name="description" value="" />
|
<option name="description" value="" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.11 (jupyter)" project-jdk-type="Python SDK" />
|
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9.18 WSL (RockyLinux): (/home/isaac/.virtualenvs/CS2333/bin/python)" project-jdk-type="Python SDK" />
|
||||||
</project>
|
</project>
|
25
.idea/runConfigurations/2024_1_12.xml
generated
25
.idea/runConfigurations/2024_1_12.xml
generated
@ -1,25 +0,0 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
|
||||||
<configuration default="false" name="2024-1-12" type="PythonConfigurationType" factoryName="Python" nameIsGenerated="true">
|
|
||||||
<module name="CS2333" />
|
|
||||||
<option name="ENV_FILES" value="" />
|
|
||||||
<option name="INTERPRETER_OPTIONS" value="" />
|
|
||||||
<option name="PARENT_ENVS" value="true" />
|
|
||||||
<envs>
|
|
||||||
<env name="PYTHONUNBUFFERED" value="1" />
|
|
||||||
</envs>
|
|
||||||
<option name="SDK_HOME" value="" />
|
|
||||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
|
||||||
<option name="IS_MODULE_SDK" value="true" />
|
|
||||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
|
||||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
|
||||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
|
||||||
<option name="SCRIPT_NAME" value="2024-1-12.py" />
|
|
||||||
<option name="PARAMETERS" value="" />
|
|
||||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
|
||||||
<option name="EMULATE_TERMINAL" value="false" />
|
|
||||||
<option name="MODULE_MODE" value="false" />
|
|
||||||
<option name="REDIRECT_INPUT" value="false" />
|
|
||||||
<option name="INPUT_FILE" value="" />
|
|
||||||
<method v="2" />
|
|
||||||
</configuration>
|
|
||||||
</component>
|
|
25
.idea/runConfigurations/2024_1_15.xml
generated
25
.idea/runConfigurations/2024_1_15.xml
generated
@ -1,25 +0,0 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
|
||||||
<configuration default="false" name="2024-1-15" type="PythonConfigurationType" factoryName="Python" nameIsGenerated="true">
|
|
||||||
<module name="CS2333" />
|
|
||||||
<option name="ENV_FILES" value="" />
|
|
||||||
<option name="INTERPRETER_OPTIONS" value="" />
|
|
||||||
<option name="PARENT_ENVS" value="true" />
|
|
||||||
<envs>
|
|
||||||
<env name="PYTHONUNBUFFERED" value="1" />
|
|
||||||
</envs>
|
|
||||||
<option name="SDK_HOME" value="" />
|
|
||||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
|
||||||
<option name="IS_MODULE_SDK" value="true" />
|
|
||||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
|
||||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
|
||||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
|
||||||
<option name="SCRIPT_NAME" value="2024-1-15.py" />
|
|
||||||
<option name="PARAMETERS" value="" />
|
|
||||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
|
||||||
<option name="EMULATE_TERMINAL" value="false" />
|
|
||||||
<option name="MODULE_MODE" value="false" />
|
|
||||||
<option name="REDIRECT_INPUT" value="false" />
|
|
||||||
<option name="INPUT_FILE" value="" />
|
|
||||||
<method v="2" />
|
|
||||||
</configuration>
|
|
||||||
</component>
|
|
17
.idea/runConfigurations/Export_A2_No_Code.xml
generated
Normal file
17
.idea/runConfigurations/Export_A2_No_Code.xml
generated
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="Export A2 No Code" type="ShConfigurationType">
|
||||||
|
<option name="SCRIPT_TEXT" value="jupyter-nbconvert.exe "Assignment 2.ipynb" --to webpdf --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>
|
@ -1,6 +1,6 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
<component name="ProjectRunConfigurationManager">
|
||||||
<configuration default="false" name="Export A1" type="ShConfigurationType">
|
<configuration default="false" name="Export A3 No Code" type="ShConfigurationType">
|
||||||
<option name="SCRIPT_TEXT" value="jupyter-nbconvert.exe "Assignment 1.ipynb" --to webpdf" />
|
<option name="SCRIPT_TEXT" value="jupyter-nbconvert.exe "Assignment 3.ipynb" --to pdf --no-input" />
|
||||||
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
|
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
|
||||||
<option name="SCRIPT_PATH" value="" />
|
<option name="SCRIPT_PATH" value="" />
|
||||||
<option name="SCRIPT_OPTIONS" value="" />
|
<option name="SCRIPT_OPTIONS" value="" />
|
17
.idea/runConfigurations/Export_A4_No_Code.xml
generated
Normal file
17
.idea/runConfigurations/Export_A4_No_Code.xml
generated
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="Export A4 No Code" type="ShConfigurationType">
|
||||||
|
<option name="SCRIPT_TEXT" value="jupyter-nbconvert.exe "Assignment 4.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
generated
Normal file
17
.idea/runConfigurations/Export_A5_No_Code.xml
generated
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
generated
Normal file
17
.idea/runConfigurations/Export_A6_No_Code.xml
generated
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>
|
17
.idea/runConfigurations/Export_A7_No_Code.xml
generated
Normal file
17
.idea/runConfigurations/Export_A7_No_Code.xml
generated
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="Export A7 No Code" type="ShConfigurationType">
|
||||||
|
<option name="SCRIPT_TEXT" value="jupyter-nbconvert.exe "Assignment 7.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_A8_No_Code.xml
generated
Normal file
17
.idea/runConfigurations/Export_A8_No_Code.xml
generated
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="Export A8 No Code" type="ShConfigurationType">
|
||||||
|
<option name="SCRIPT_TEXT" value="jupyter-nbconvert.exe "Assignment 8.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>
|
@ -19,8 +19,8 @@
|
|||||||
"metadata": {
|
"metadata": {
|
||||||
"collapsed": false,
|
"collapsed": false,
|
||||||
"ExecuteTime": {
|
"ExecuteTime": {
|
||||||
"end_time": "2024-01-18T21:45:24.278399500Z",
|
"end_time": "2024-01-19T18:00:01.812390600Z",
|
||||||
"start_time": "2024-01-18T21:45:24.273024200Z"
|
"start_time": "2024-01-19T18:00:01.808045100Z"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
@ -79,8 +79,8 @@
|
|||||||
"metadata": {
|
"metadata": {
|
||||||
"collapsed": false,
|
"collapsed": false,
|
||||||
"ExecuteTime": {
|
"ExecuteTime": {
|
||||||
"end_time": "2024-01-18T21:45:24.284569900Z",
|
"end_time": "2024-01-19T18:00:01.833000200Z",
|
||||||
"start_time": "2024-01-18T21:45:24.278399500Z"
|
"start_time": "2024-01-19T18:00:01.813388900Z"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@ -124,8 +124,8 @@
|
|||||||
"metadata": {
|
"metadata": {
|
||||||
"collapsed": false,
|
"collapsed": false,
|
||||||
"ExecuteTime": {
|
"ExecuteTime": {
|
||||||
"end_time": "2024-01-18T21:45:24.288935300Z",
|
"end_time": "2024-01-19T18:00:01.833998900Z",
|
||||||
"start_time": "2024-01-18T21:45:24.286415200Z"
|
"start_time": "2024-01-19T18:00:01.819489500Z"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@ -168,8 +168,8 @@
|
|||||||
"metadata": {
|
"metadata": {
|
||||||
"collapsed": false,
|
"collapsed": false,
|
||||||
"ExecuteTime": {
|
"ExecuteTime": {
|
||||||
"end_time": "2024-01-18T21:45:24.296122800Z",
|
"end_time": "2024-01-19T18:00:01.833998900Z",
|
||||||
"start_time": "2024-01-18T21:45:24.289936100Z"
|
"start_time": "2024-01-19T18:00:01.824503300Z"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@ -210,8 +210,8 @@
|
|||||||
"metadata": {
|
"metadata": {
|
||||||
"collapsed": false,
|
"collapsed": false,
|
||||||
"ExecuteTime": {
|
"ExecuteTime": {
|
||||||
"end_time": "2024-01-18T21:45:24.298113500Z",
|
"end_time": "2024-01-19T18:00:01.836315700Z",
|
||||||
"start_time": "2024-01-18T21:45:24.293966900Z"
|
"start_time": "2024-01-19T18:00:01.830000300Z"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@ -261,8 +261,8 @@
|
|||||||
"metadata": {
|
"metadata": {
|
||||||
"collapsed": false,
|
"collapsed": false,
|
||||||
"ExecuteTime": {
|
"ExecuteTime": {
|
||||||
"end_time": "2024-01-18T21:45:24.340947500Z",
|
"end_time": "2024-01-19T18:00:01.843841300Z",
|
||||||
"start_time": "2024-01-18T21:45:24.299113600Z"
|
"start_time": "2024-01-19T18:00:01.834999100Z"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@ -302,8 +302,8 @@
|
|||||||
"metadata": {
|
"metadata": {
|
||||||
"collapsed": false,
|
"collapsed": false,
|
||||||
"ExecuteTime": {
|
"ExecuteTime": {
|
||||||
"end_time": "2024-01-18T21:45:24.341947200Z",
|
"end_time": "2024-01-19T18:00:01.924237300Z",
|
||||||
"start_time": "2024-01-18T21:45:24.303632300Z"
|
"start_time": "2024-01-19T18:00:01.838835700Z"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@ -351,8 +351,8 @@
|
|||||||
"metadata": {
|
"metadata": {
|
||||||
"collapsed": false,
|
"collapsed": false,
|
||||||
"ExecuteTime": {
|
"ExecuteTime": {
|
||||||
"end_time": "2024-01-18T21:45:24.341947200Z",
|
"end_time": "2024-01-19T18:00:01.925239100Z",
|
||||||
"start_time": "2024-01-18T21:45:24.307343300Z"
|
"start_time": "2024-01-19T18:00:01.844838400Z"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@ -398,9 +398,9 @@
|
|||||||
"collapsed": false
|
"collapsed": false
|
||||||
},
|
},
|
||||||
"source": [
|
"source": [
|
||||||
"First it could be helpful to find the set of all valid games to compare against. This is a little tricky as first you need to know the rules of the game and encode them correctly. The rules that I have discerned are as follows:\n",
|
"First, it could be helpful to find the set of all valid games to compare against. This is a little tricky as first you need to know the rules of the game and encode them correctly as a language. The rules that I have discerned are as follows:\n",
|
||||||
"1. Each valid game has 3 a's or 3 b's, denoting a victory for one side\n",
|
"1. Each valid game has 3 a's or 3 b's, denoting a victory for one side\n",
|
||||||
"2. Once it has either victories on either side, the game does not continue, and the string is complete\n",
|
"2. Once either side has won, the game does not continue, and the string is complete\n",
|
||||||
"\n",
|
"\n",
|
||||||
"$$L = \\{w \\in \\{a,b\\}^* | n_a(w) = 3 \\text{ or } n_b(w) = 3 \\text{ and } w \\text{ does not end with the opposite letter}\\}$$"
|
"$$L = \\{w \\in \\{a,b\\}^* | n_a(w) = 3 \\text{ or } n_b(w) = 3 \\text{ and } w \\text{ does not end with the opposite letter}\\}$$"
|
||||||
]
|
]
|
||||||
@ -412,8 +412,8 @@
|
|||||||
"metadata": {
|
"metadata": {
|
||||||
"collapsed": false,
|
"collapsed": false,
|
||||||
"ExecuteTime": {
|
"ExecuteTime": {
|
||||||
"end_time": "2024-01-18T21:45:24.342947100Z",
|
"end_time": "2024-01-19T18:00:01.926239100Z",
|
||||||
"start_time": "2024-01-18T21:45:24.314341500Z"
|
"start_time": "2024-01-19T18:00:01.849939800Z"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@ -455,7 +455,7 @@
|
|||||||
"source": [
|
"source": [
|
||||||
"(a) $L_1 = \\{w \\in \\{a,b\\}^* | n_a(w) = 3 \\text{ or } n_b(w) = 3 \\}$\n",
|
"(a) $L_1 = \\{w \\in \\{a,b\\}^* | n_a(w) = 3 \\text{ or } n_b(w) = 3 \\}$\n",
|
||||||
"\n",
|
"\n",
|
||||||
"This one is not representable with code, as the set is produces is infinite. This language places no restrictions on the length of the string, so \"aaabbbbbbbbbbbbbbbbbbbbbbbbbbb\" is a valid string in this language. So here is a few examples of valid strings in this language that are not valid in the original language L but are in this language:\n",
|
"This language is not representable with code, as the set is produces is infinite. This language places no restrictions on the length of the string, so \"aaabbbbbbbbbbbbbbbbbbbbbbbbbbb\" is a valid string in this language. So here is a few examples of valid strings in this language that are not valid in the original:\n",
|
||||||
"\n",
|
"\n",
|
||||||
"1. \"aaabbbbbbbbbbbbbbbbbbbbbbbbbbb\"\n",
|
"1. \"aaabbbbbbbbbbbbbbbbbbbbbbbbbbb\"\n",
|
||||||
"2. \"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbaaa\"\n",
|
"2. \"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbaaa\"\n",
|
||||||
@ -471,7 +471,7 @@
|
|||||||
"source": [
|
"source": [
|
||||||
"(b) $L_2 = \\{w \\in \\{a,b\\}^* | |w| \\leq 5, \\text{ and } n_a(w) = 3 \\text{ or } n_b(w) = 3 \\}$\n",
|
"(b) $L_2 = \\{w \\in \\{a,b\\}^* | |w| \\leq 5, \\text{ and } n_a(w) = 3 \\text{ or } n_b(w) = 3 \\}$\n",
|
||||||
"\n",
|
"\n",
|
||||||
"This language has the problem is not encoding the rule that the game stops once a player has 3 a's or 3 b's. This can be seen in these strings that are valid in this language but not in the original language L:"
|
"This language differs as it is not encoding the rule that the game stops once a player has 3 a's or 3 b's. This can be seen in these strings that are valid in this language but not in the original language L:"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -481,8 +481,8 @@
|
|||||||
"metadata": {
|
"metadata": {
|
||||||
"collapsed": false,
|
"collapsed": false,
|
||||||
"ExecuteTime": {
|
"ExecuteTime": {
|
||||||
"end_time": "2024-01-18T21:45:24.342947100Z",
|
"end_time": "2024-01-19T18:00:01.926239100Z",
|
||||||
"start_time": "2024-01-18T21:45:24.317844500Z"
|
"start_time": "2024-01-19T18:00:01.854940200Z"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@ -514,7 +514,7 @@
|
|||||||
"source": [
|
"source": [
|
||||||
"(c) $L_3 = \\{w \\in \\{a,b\\}^* | (n_a(w) = 3 \\text{ and } n_b(w) < 3) \\text{ or } (n_b(w) = 3 \\text{ and } n_a(w) < 3) \\}$\n",
|
"(c) $L_3 = \\{w \\in \\{a,b\\}^* | (n_a(w) = 3 \\text{ and } n_b(w) < 3) \\text{ or } (n_b(w) = 3 \\text{ and } n_a(w) < 3) \\}$\n",
|
||||||
"\n",
|
"\n",
|
||||||
"This language has a similar problem to the previous one, in that it does not encode the rule that the game stops once a player has 3 a's or 3 b's. The difference in this language is that the limit of string length 5 is not explicitly stated, however it is encoded to be that way by saying that if there are 3 a's then there must be less than 3 b's, and vice versa. This means that the effective maximum length of the string is 5, and thus the language is equivalent to the language from the previous question.\n",
|
"This language is similar to the previous one, in that it does not encode the rule that the game stops once a player has 3 a's or 3 b's. The difference in this language is that the limit of string length 5 is not explicitly stated, however it is encoded to be that way by saying that if there are 3 a's then there must be less than 3 b's, and vice versa. This means that the effective maximum length of the string is 5, and thus the language is equivalent to the language from the previous question.\n",
|
||||||
"$$\n",
|
"$$\n",
|
||||||
"x, y \\in \\mathbb{Z}^* \\\\\n",
|
"x, y \\in \\mathbb{Z}^* \\\\\n",
|
||||||
"x = 3 \\\\\n",
|
"x = 3 \\\\\n",
|
||||||
@ -531,8 +531,8 @@
|
|||||||
"metadata": {
|
"metadata": {
|
||||||
"collapsed": false,
|
"collapsed": false,
|
||||||
"ExecuteTime": {
|
"ExecuteTime": {
|
||||||
"end_time": "2024-01-18T21:45:24.342947100Z",
|
"end_time": "2024-01-19T18:00:01.927237Z",
|
||||||
"start_time": "2024-01-18T21:45:24.323363100Z"
|
"start_time": "2024-01-19T18:00:01.860724500Z"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
|
282
Assignment 2.ipynb
Normal file
282
Assignment 2.ipynb
Normal file
@ -0,0 +1,282 @@
|
|||||||
|
{
|
||||||
|
"cells": [
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"source": [
|
||||||
|
"# Question 6\n",
|
||||||
|
"Let $S = \\{0,1\\}^*$ be the set of all strings of zero and ones, which includes the empty string $\\epsilon$.\n",
|
||||||
|
"Let $h : S \\rightarrow \\mathbb{Z}^*$ be the function defined by $h(x)$ equal the number of zeros in $x$ multiplied by the number of ones in $x$\n",
|
||||||
|
"For example, $h(00100011) = 5 \\times 3 = 15, and h(111) = 0 \\times 3 = 0$\n",
|
||||||
|
"\n",
|
||||||
|
"(a) Is $h$ one-to-one? No, because both strings $001$ and $110$ map to the same value, $2$\n",
|
||||||
|
"$2 \\times 1 = 2$ and $1 \\times 2 = 2$\n",
|
||||||
|
"\n",
|
||||||
|
"(b) Is $h$ onto? Yes, because you can find every non-negative integer by multiplying any number of ones by one zero $(1 \\times 1), (1 \\times 2), ...$\n",
|
||||||
|
"Let the number of zeros be exactly 1, and n be the number of ones, and m be any non-negative integer\n",
|
||||||
|
"$h(n) = m, 1n = m, n = m$ "
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false
|
||||||
|
},
|
||||||
|
"id": "b67364155fcb1072"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"source": [
|
||||||
|
"<div style=\"page-break-after: always;\"></div>"
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false
|
||||||
|
},
|
||||||
|
"id": "ec5269e5b4749d08"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"source": [
|
||||||
|
"# Question 8\n",
|
||||||
|
"(a)\n",
|
||||||
|
"This function is not one-to-one (111110, 1111100 are both 5)\n",
|
||||||
|
"This function is onto (10, 110, 1110, 11...0 is all non-negative integers)\n",
|
||||||
|
"\n",
|
||||||
|
"(b)\n",
|
||||||
|
"This function is not one-to-one (11111, 01111 are both 1)\n",
|
||||||
|
"This function is onto (All strings are mapped to, as you can simply pad any character with any 4 characters first)\n",
|
||||||
|
"\n",
|
||||||
|
"(c)\n",
|
||||||
|
"This function is not one-to-one (Quebec, Yukon both are 0)\n",
|
||||||
|
"This function is not onto (None of the provinces contain 3 or 5 a's"
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false
|
||||||
|
},
|
||||||
|
"id": "ead9052998c5edf6"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"source": [
|
||||||
|
"<div style=\"page-break-after: always;\"></div>"
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false
|
||||||
|
},
|
||||||
|
"id": "f27520443479cce9"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"source": [
|
||||||
|
"# Question 9\n",
|
||||||
|
"Consider the relation $R$ defined on the set $\\mathbb{Z}$ as follows:\n",
|
||||||
|
"$$R = \\{(m,n) | m,n \\in \\mathbb{Z}, mn < 0\\}$$\n",
|
||||||
|
"\n",
|
||||||
|
"(a) Is the relation reflexive? No\n",
|
||||||
|
"For every integer $x$, $x \\times x = x^2$, and by the definition of squares, can never be less than zero\n",
|
||||||
|
"\n",
|
||||||
|
"(b) Is the relation symmetric? Yes\n",
|
||||||
|
"Let $x, y$ be a pair of integers in the relation and $z$ be the product of $x and y$, so $x \\times y = -z$\n",
|
||||||
|
"Since multiplication is commutative, the position of $x$ and $y$ do not matter, so $(x,y)$ and $(y,x)$ are in the relation\n",
|
||||||
|
"(Both $x \\times y$ and $y \\times x$ equal $-z$)\n",
|
||||||
|
"\n",
|
||||||
|
"(c) Is the relation transitive? No\n",
|
||||||
|
"Let $a = 1, b = -2, c = 3$\n",
|
||||||
|
"$1 \\times -2 = -2$ and $-2 \\times 3 = -6$, however $1 \\times 3 = 3$, which is $> 0$\n",
|
||||||
|
"$\\therefore$ this relation is not transitive\n",
|
||||||
|
"\n",
|
||||||
|
"(d) Is this an equivalence relation? No, because these three conditions are not met"
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false
|
||||||
|
},
|
||||||
|
"id": "874c8dbcc345edad"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"source": [
|
||||||
|
"<div style=\"page-break-after: always;\"></div>"
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false
|
||||||
|
},
|
||||||
|
"id": "ca477f12a96f397a"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"source": [
|
||||||
|
"# Question 11\n",
|
||||||
|
"Consider the relation $R$ defined on the set $\\mathbb{Z}$ as follows:\n",
|
||||||
|
"$$\\forall m,n \\in \\mathbb{Z}, (m,n) \\in R \\text{ if and only if } m + n = 2k \\text{ for some integer } k$$\n",
|
||||||
|
"\n",
|
||||||
|
"(a) Is this relation reflexive? Yes\n",
|
||||||
|
"For every integer $x$, $x + x = 2x$, therefore it is reflexive\n",
|
||||||
|
"\n",
|
||||||
|
"(b) Is this relation symmetric? Yes\n",
|
||||||
|
"Let $x, y$ be a pair of integers in the relation and $z$ be the sum of these integers, so $x + y = 2z$\n",
|
||||||
|
"Since addition is commutative, the position of $x$ and $y$ do not matter, so $(x,y) and $(y,x) are in the relation\n",
|
||||||
|
"(Both $x + y$ and $y + x$ equal $2z$)\n",
|
||||||
|
"\n",
|
||||||
|
"(c) Is this relation transitive? Yes\n",
|
||||||
|
"Let $(a,b)$ and $(b,c)$ be valid pairs of integers of the relation $R$\n",
|
||||||
|
"$a + b = 2n$, and $b + c = 2p$, then $b = 2n - a$ and $b = 2p - c$\n",
|
||||||
|
"$-2n + a = 2p - c$\n",
|
||||||
|
"$a + c = 2p + 2n$\n",
|
||||||
|
"Since the sum of a and c is the sum of two even numbers (numbers multiplied by 2 must be even), then the result must be even, so the result is divisible by 2\n",
|
||||||
|
"$\\therefore$ The relationship is transitive"
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false
|
||||||
|
},
|
||||||
|
"id": "5fe823d05dd08b12"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"source": [
|
||||||
|
"<div style=\"page-break-after: always;\"></div>"
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false
|
||||||
|
},
|
||||||
|
"id": "889a2a7359618ee7"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"source": [
|
||||||
|
"# Question 14\n",
|
||||||
|
"There are 7 equivalence classes as the results are grouped by the integer returned by $n_0(x) - n_1(x)$/$n_0(y) - n_1(y)$ for any relation pair, the results are that being set of differences $\\{-3, -2, -1, 0, 1, 2, 3\\}$"
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false
|
||||||
|
},
|
||||||
|
"id": "fd69c73a15e8e6a0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"{-3: [('111', '111')],\n",
|
||||||
|
" -2: [('11', '11')],\n",
|
||||||
|
" -1: [('1', '1'),\n",
|
||||||
|
" ('1', '011'),\n",
|
||||||
|
" ('1', '101'),\n",
|
||||||
|
" ('1', '110'),\n",
|
||||||
|
" ('011', '1'),\n",
|
||||||
|
" ('011', '011'),\n",
|
||||||
|
" ('011', '101'),\n",
|
||||||
|
" ('011', '110'),\n",
|
||||||
|
" ('101', '1'),\n",
|
||||||
|
" ('101', '011'),\n",
|
||||||
|
" ('101', '101'),\n",
|
||||||
|
" ('101', '110'),\n",
|
||||||
|
" ('110', '1'),\n",
|
||||||
|
" ('110', '011'),\n",
|
||||||
|
" ('110', '101'),\n",
|
||||||
|
" ('110', '110')],\n",
|
||||||
|
" 0: [('', ''),\n",
|
||||||
|
" ('', '01'),\n",
|
||||||
|
" ('', '10'),\n",
|
||||||
|
" ('01', ''),\n",
|
||||||
|
" ('01', '01'),\n",
|
||||||
|
" ('01', '10'),\n",
|
||||||
|
" ('10', ''),\n",
|
||||||
|
" ('10', '01'),\n",
|
||||||
|
" ('10', '10')],\n",
|
||||||
|
" 1: [('0', '0'),\n",
|
||||||
|
" ('0', '001'),\n",
|
||||||
|
" ('0', '010'),\n",
|
||||||
|
" ('0', '100'),\n",
|
||||||
|
" ('001', '0'),\n",
|
||||||
|
" ('001', '001'),\n",
|
||||||
|
" ('001', '010'),\n",
|
||||||
|
" ('001', '100'),\n",
|
||||||
|
" ('010', '0'),\n",
|
||||||
|
" ('010', '001'),\n",
|
||||||
|
" ('010', '010'),\n",
|
||||||
|
" ('010', '100'),\n",
|
||||||
|
" ('100', '0'),\n",
|
||||||
|
" ('100', '001'),\n",
|
||||||
|
" ('100', '010'),\n",
|
||||||
|
" ('100', '100')],\n",
|
||||||
|
" 2: [('00', '00')],\n",
|
||||||
|
" 3: [('000', '000')]}\n"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"# Set of all strings containing 0 and 1 up to length 3\n",
|
||||||
|
"def get_all_strings_with_a_given_alphabet_and_length(_alphabet, _length):\n",
|
||||||
|
"\t_strings = ['']\n",
|
||||||
|
"\tfor i in range(_length):\n",
|
||||||
|
"\t\ts = [s + c for s in _strings for c in _alphabet]\n",
|
||||||
|
"\t\t_strings += s\n",
|
||||||
|
"\n",
|
||||||
|
"\t# Remove duplicates (set() isn't as nice as it doesn't preserve order, at least for verification purposes)\n",
|
||||||
|
"\t_strings = list(dict.fromkeys(_strings))\n",
|
||||||
|
"\treturn _strings\n",
|
||||||
|
"\n",
|
||||||
|
"alphabet = ['0', '1']\n",
|
||||||
|
"strings = get_all_strings_with_a_given_alphabet_and_length(alphabet, 3)\n",
|
||||||
|
"\n",
|
||||||
|
"# The relation is valid if the number of zeros from string x minus the number of ones from string x is equal to the number of zeros from string y minus the number of ones from string y\n",
|
||||||
|
"def is_valid_relation(_x, _y):\n",
|
||||||
|
"\t# Count the number of zeros and ones in each string\n",
|
||||||
|
"\tx_zeros = _x.count('0')\n",
|
||||||
|
"\tx_ones = _x.count('1')\n",
|
||||||
|
"\ty_zeros = _y.count('0')\n",
|
||||||
|
"\ty_ones = _y.count('1')\n",
|
||||||
|
"\n",
|
||||||
|
"\t# Return true if the difference between the number of zeros and ones is equal\n",
|
||||||
|
"\treturn (x_zeros - x_ones) == (y_zeros - y_ones)\n",
|
||||||
|
"\n",
|
||||||
|
"from collections import defaultdict\n",
|
||||||
|
"\n",
|
||||||
|
"# Print all valid relations\n",
|
||||||
|
"equivalence_classes = defaultdict(list)\n",
|
||||||
|
"for x in strings:\n",
|
||||||
|
"\tfor y in strings:\n",
|
||||||
|
"\t\tif is_valid_relation(x, y):\n",
|
||||||
|
"\t\t\t# create a tuple of the two strings\n",
|
||||||
|
"\t\t\tt = (x, y)\n",
|
||||||
|
"\t\t\t# calculate the difference between the number of zeros and ones\n",
|
||||||
|
"\t\t\td = x.count('0') - x.count('1')\n",
|
||||||
|
"\t\t\t# add the tuple a list under the key of the difference\n",
|
||||||
|
"\t\t\tequivalence_classes[d].append(t)\n",
|
||||||
|
"\t\t\t\t\n",
|
||||||
|
"# Print the dict\n",
|
||||||
|
"equivalence_classes = dict(equivalence_classes)\n",
|
||||||
|
"from pprint import pprint\n",
|
||||||
|
"pprint(equivalence_classes)"
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false,
|
||||||
|
"ExecuteTime": {
|
||||||
|
"end_time": "2024-01-26T22:03:01.411977200Z",
|
||||||
|
"start_time": "2024-01-26T22:03:01.364977700Z"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"id": "94712ae197e8639c",
|
||||||
|
"execution_count": 5
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"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
|
||||||
|
}
|
562
Assignment 3.ipynb
Normal file
562
Assignment 3.ipynb
Normal file
File diff suppressed because one or more lines are too long
495
Assignment 4.ipynb
Normal file
495
Assignment 4.ipynb
Normal file
File diff suppressed because one or more lines are too long
700
Assignment 5.ipynb
Normal file
700
Assignment 5.ipynb
Normal file
@ -0,0 +1,700 @@
|
|||||||
|
{
|
||||||
|
"cells": [
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"import automata.regex.regex as re\n",
|
||||||
|
"from automata.fa.nfa import NFA\n",
|
||||||
|
"from IPython.display import Math\n",
|
||||||
|
"\n",
|
||||||
|
"debug = True\n",
|
||||||
|
"\n",
|
||||||
|
"def regex_test(regex: str, inputs: list[str]):\n",
|
||||||
|
" re.validate(regex)\n",
|
||||||
|
" nfa = NFA.from_regex(regex)\n",
|
||||||
|
" for i in inputs:\n",
|
||||||
|
" print(f\"{i}: {nfa.accepts_input(i)}\")\n",
|
||||||
|
" \n",
|
||||||
|
"def latexify(regex: str):\n",
|
||||||
|
" steps = regex\n",
|
||||||
|
" steps = steps.replace('()', '\\\\epsilon')\n",
|
||||||
|
" steps = steps.replace('(', '\\\\left(')\n",
|
||||||
|
" steps = steps.replace(')', '\\\\right)')\n",
|
||||||
|
" steps = steps.replace('|', '\\\\cup')\n",
|
||||||
|
" steps = steps.replace('&', '\\\\land')\n",
|
||||||
|
" steps = steps.replace('*', '^*')\n",
|
||||||
|
" steps = '$' + steps + '$'\n",
|
||||||
|
" return steps"
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false,
|
||||||
|
"ExecuteTime": {
|
||||||
|
"end_time": "2024-03-22T22:22:26.498255Z",
|
||||||
|
"start_time": "2024-03-22T22:22:26.217210Z"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"id": "aa9fd8c82c66ac9a",
|
||||||
|
"execution_count": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"{'aaaab', 'a', 'b', 'aaab', 'ab', 'aaaa', 'aab'}\n",
|
||||||
|
"['baaaa', 'ba', 'baab', 'baaaaa', 'baa', 'baaab']\n",
|
||||||
|
"['', 'b', 'bb', 'bbb', 'bba', 'ba', 'bab']\n"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"l1 = ['b', 'ba']\n",
|
||||||
|
"l2 = ['a', 'aab', 'aaaa']\n",
|
||||||
|
"l3 = []\n",
|
||||||
|
"for i in range(0, 5):\n",
|
||||||
|
" l3.append('a' * i + 'b')\n",
|
||||||
|
"# turn all of these into sets\n",
|
||||||
|
"l1 = set(l1)\n",
|
||||||
|
"l2 = set(l2)\n",
|
||||||
|
"l3 = set(l3)\n",
|
||||||
|
"\n",
|
||||||
|
"# l2 union l3\n",
|
||||||
|
"l2.union(l3)\n",
|
||||||
|
"if debug:\n",
|
||||||
|
" print(l2.union(l3))\n",
|
||||||
|
"# l1 times l2\n",
|
||||||
|
"a = []\n",
|
||||||
|
"for i in l1:\n",
|
||||||
|
" for j in l2:\n",
|
||||||
|
" a.append(i + j)\n",
|
||||||
|
"if debug:\n",
|
||||||
|
" print(a)\n",
|
||||||
|
"\n",
|
||||||
|
"# kleen star of l1 up to length 3\n",
|
||||||
|
"a = ['']\n",
|
||||||
|
"for i in l1:\n",
|
||||||
|
" a.append(i)\n",
|
||||||
|
" for j in l1:\n",
|
||||||
|
" a.append(i + j)\n",
|
||||||
|
" for k in l1:\n",
|
||||||
|
" a.append(i + j + k)\n",
|
||||||
|
"# remove all strings of length greater than 3\n",
|
||||||
|
"a = [x for x in a if len(x) <= 3]\n",
|
||||||
|
"if debug:\n",
|
||||||
|
" print(a)"
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": true,
|
||||||
|
"ExecuteTime": {
|
||||||
|
"end_time": "2024-03-22T22:22:26.505139Z",
|
||||||
|
"start_time": "2024-03-22T22:22:26.499628Z"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"id": "initial_id",
|
||||||
|
"execution_count": 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"source": [
|
||||||
|
"# Question 28\n",
|
||||||
|
"## b.\n",
|
||||||
|
"aaab, aaaa, a, aaaab, b, ab, aab\n",
|
||||||
|
"\n",
|
||||||
|
"## c.\n",
|
||||||
|
"baaaaa, baaab, baa, baaaa, baab, ba\n",
|
||||||
|
"\n",
|
||||||
|
"## e. \n",
|
||||||
|
"$\\epsilon$, ba, bab, b, bba, bb, bbb\n",
|
||||||
|
"\n",
|
||||||
|
"## h.\n",
|
||||||
|
"Yes, because the Kleen star of $L_1$ includes all original strings in the language, and the string 'b', where n is zero is included in $(L_1)^*$, so it is possible for $(L_1)^*$ to have a string where there is more bs than as. "
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false
|
||||||
|
},
|
||||||
|
"id": "823eb4c275b95911"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"source": [
|
||||||
|
"$\\pagebreak$"
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false
|
||||||
|
},
|
||||||
|
"id": "ae5527f9dab42f59"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"source": [
|
||||||
|
"# Question 30\n",
|
||||||
|
"## c."
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false
|
||||||
|
},
|
||||||
|
"id": "5f0f62a85e3cddd0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"aabb: False\n",
|
||||||
|
"aabbbb: False\n",
|
||||||
|
"aabbbbb: True\n",
|
||||||
|
"aaabbbbbb: False\n",
|
||||||
|
"aaaabbbbbbbbb: True\n"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"text/plain": "<IPython.core.display.Math object>",
|
||||||
|
"text/latex": "$\\displaystyle \\left(aa\\right)^*\\left(bbbb\\right)^*b$"
|
||||||
|
},
|
||||||
|
"execution_count": 3,
|
||||||
|
"metadata": {},
|
||||||
|
"output_type": "execute_result"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"# Define a regex where 'a' is a multiple of 2 and 'b' is a multiple of 4 + 1\n",
|
||||||
|
"q31c = '(aa)*(bbbb)*b'\n",
|
||||||
|
"inputs = [\n",
|
||||||
|
"\t'aabb',\n",
|
||||||
|
"\t'aabbbb',\n",
|
||||||
|
"\t'aabbbbb',\n",
|
||||||
|
"\t'aaabbbbbb',\n",
|
||||||
|
"\t'aaaabbbbbbbbb',\n",
|
||||||
|
"]\n",
|
||||||
|
"if debug:\n",
|
||||||
|
" regex_test(q31c, inputs)\n",
|
||||||
|
"Math(latexify(q31c))"
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false,
|
||||||
|
"ExecuteTime": {
|
||||||
|
"end_time": "2024-03-22T22:22:26.515494Z",
|
||||||
|
"start_time": "2024-03-22T22:22:26.506412Z"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"id": "c0d81b8fb61431de",
|
||||||
|
"execution_count": 3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"source": [
|
||||||
|
"## d."
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false
|
||||||
|
},
|
||||||
|
"id": "53e09c458eafb680"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"ab: True\n",
|
||||||
|
"bab: False\n",
|
||||||
|
"bbab: True\n",
|
||||||
|
"bbbabb: True\n",
|
||||||
|
"bbbabbb: False\n",
|
||||||
|
"abb: False\n",
|
||||||
|
"abbb: True\n",
|
||||||
|
"ba: True\n",
|
||||||
|
"bba: False\n",
|
||||||
|
"bbba: True\n"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"text/plain": "<IPython.core.display.Math object>",
|
||||||
|
"text/latex": "$\\displaystyle \\left(\\left(bb\\right)^*ba\\left(bb\\right)^*\\right)\\cup\\left(\\left(bb\\right)^*ab\\left(bb\\right)^*\\right)$"
|
||||||
|
},
|
||||||
|
"execution_count": 4,
|
||||||
|
"metadata": {},
|
||||||
|
"output_type": "execute_result"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"# Define a regex where the number of as is 1 and the number of bs is odd\n",
|
||||||
|
"q31e = \"((bb)*ba(bb)*)|((bb)*ab(bb)*)\"\n",
|
||||||
|
"inputs = [\n",
|
||||||
|
" 'ab',\n",
|
||||||
|
" 'bab',\n",
|
||||||
|
" 'bbab',\n",
|
||||||
|
" 'bbbabb',\n",
|
||||||
|
" 'bbbabbb',\n",
|
||||||
|
" 'abb',\n",
|
||||||
|
" 'abbb',\n",
|
||||||
|
" 'ba',\n",
|
||||||
|
" 'bba',\n",
|
||||||
|
" 'bbba',\n",
|
||||||
|
"]\n",
|
||||||
|
"if debug:\n",
|
||||||
|
" regex_test(q31e, inputs)\n",
|
||||||
|
"Math(latexify(q31e))"
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false,
|
||||||
|
"ExecuteTime": {
|
||||||
|
"end_time": "2024-03-22T22:22:26.522964Z",
|
||||||
|
"start_time": "2024-03-22T22:22:26.517188Z"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"id": "75f2af38daefc05b",
|
||||||
|
"execution_count": 4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"source": [
|
||||||
|
"$\\pagebreak$"
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false
|
||||||
|
},
|
||||||
|
"id": "9271ff95c0925816"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"source": [
|
||||||
|
"# Question 31\n",
|
||||||
|
"## c."
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false
|
||||||
|
},
|
||||||
|
"id": "c4c41d43969e22bb"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
": True\n",
|
||||||
|
"0: True\n",
|
||||||
|
"1: True\n",
|
||||||
|
"00: True\n",
|
||||||
|
"01: True\n",
|
||||||
|
"10: True\n",
|
||||||
|
"11: True\n",
|
||||||
|
"000: True\n",
|
||||||
|
"001: True\n",
|
||||||
|
"010: True\n",
|
||||||
|
"011: True\n",
|
||||||
|
"100: True\n",
|
||||||
|
"101: True\n",
|
||||||
|
"0000: True\n",
|
||||||
|
"0001: True\n",
|
||||||
|
"0010: True\n",
|
||||||
|
"0011: True\n",
|
||||||
|
"0100: True\n",
|
||||||
|
"0101: True\n",
|
||||||
|
"0110: True\n",
|
||||||
|
"0111: True\n",
|
||||||
|
"1000: True\n",
|
||||||
|
"00000: False\n",
|
||||||
|
"11111: False\n"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"text/plain": "<IPython.core.display.Math object>",
|
||||||
|
"text/latex": "$\\displaystyle \\epsilon\\cup\\left(0\\cup1\\right)\\cup\\left(0\\cup1\\right)\\left(0\\cup1\\right)\\cup\\left(0\\cup1\\right)\\left(0\\cup1\\right)\\left(0\\cup1\\right)\\cup\\left(0\\cup1\\right)\\left(0\\cup1\\right)\\left(0\\cup1\\right)\\left(0\\cup1\\right)$"
|
||||||
|
},
|
||||||
|
"execution_count": 5,
|
||||||
|
"metadata": {},
|
||||||
|
"output_type": "execute_result"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"# Define a regex where the number of 1s or 0s is less than or equal to 4\n",
|
||||||
|
"q31c = '()|(0|1)|(0|1)(0|1)|(0|1)(0|1)(0|1)|(0|1)(0|1)(0|1)(0|1)'\n",
|
||||||
|
"inputs = [\n",
|
||||||
|
" '',\n",
|
||||||
|
" '0',\n",
|
||||||
|
" '1',\n",
|
||||||
|
" '00',\n",
|
||||||
|
" '01',\n",
|
||||||
|
" '10',\n",
|
||||||
|
" '11',\n",
|
||||||
|
" '000',\n",
|
||||||
|
" '001',\n",
|
||||||
|
" '010',\n",
|
||||||
|
" '011',\n",
|
||||||
|
" '100',\n",
|
||||||
|
" '101',\n",
|
||||||
|
" '0000',\n",
|
||||||
|
" '0001',\n",
|
||||||
|
" '0010',\n",
|
||||||
|
" '0011',\n",
|
||||||
|
" '0100',\n",
|
||||||
|
" '0101',\n",
|
||||||
|
" '0110',\n",
|
||||||
|
" '0111',\n",
|
||||||
|
" '1000',\n",
|
||||||
|
" '00000',\n",
|
||||||
|
" '11111',\n",
|
||||||
|
"]\n",
|
||||||
|
"if debug:\n",
|
||||||
|
" regex_test(q31c, inputs)\n",
|
||||||
|
"Math(latexify(q31c))"
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false,
|
||||||
|
"ExecuteTime": {
|
||||||
|
"end_time": "2024-03-22T22:22:26.531449Z",
|
||||||
|
"start_time": "2024-03-22T22:22:26.524511Z"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"id": "404b569fb1f1b3dd",
|
||||||
|
"execution_count": 5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"source": [
|
||||||
|
"## e."
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false
|
||||||
|
},
|
||||||
|
"id": "64279b55169daadf"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"0100001: True\n",
|
||||||
|
"0100000100001: True\n",
|
||||||
|
"1000001: True\n",
|
||||||
|
"00000010000100000: True\n",
|
||||||
|
"1000100001: False\n"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"text/plain": "<IPython.core.display.Math object>",
|
||||||
|
"text/latex": "$\\displaystyle 0^*1\\left(00000^*1\\right)^*\\left(00000^*1\\right)0^*$"
|
||||||
|
},
|
||||||
|
"execution_count": 6,
|
||||||
|
"metadata": {},
|
||||||
|
"output_type": "execute_result"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"# Define a regex where the number of 1s is greater or equal to 2 and there are at least four zeros between each 1 and the next 1\n",
|
||||||
|
"q31e = '0*1(00000*1)*(00000*1)0*'\n",
|
||||||
|
"# 0*1 = 0 or more zeros followed by a 1\n",
|
||||||
|
"# (00000*1) = 4 or more zeros followed by a 1\n",
|
||||||
|
"inputs = [\n",
|
||||||
|
" '0100001',\n",
|
||||||
|
" '0100000100001',\n",
|
||||||
|
" '1000001',\n",
|
||||||
|
" '00000010000100000',\n",
|
||||||
|
" '1000100001',\n",
|
||||||
|
"]\n",
|
||||||
|
"if debug:\n",
|
||||||
|
" regex_test(q31e, inputs)\n",
|
||||||
|
"Math(latexify(q31e))"
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false,
|
||||||
|
"ExecuteTime": {
|
||||||
|
"end_time": "2024-03-22T22:22:26.538114Z",
|
||||||
|
"start_time": "2024-03-22T22:22:26.532887Z"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"id": "91ecde46ccfd6037",
|
||||||
|
"execution_count": 6
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"source": [
|
||||||
|
"$\\pagebreak$"
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false
|
||||||
|
},
|
||||||
|
"id": "a5ed03840b4cc1a0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"source": [
|
||||||
|
"# Question 32"
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false
|
||||||
|
},
|
||||||
|
"id": "bf475fac64302b91"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"00100: True\n",
|
||||||
|
"00100: True\n",
|
||||||
|
"00100: False\n"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"text/plain": "<IPython.core.display.Math object>",
|
||||||
|
"text/latex": "$\\displaystyle 00100$"
|
||||||
|
},
|
||||||
|
"execution_count": 7,
|
||||||
|
"metadata": {},
|
||||||
|
"output_type": "execute_result"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"# Let R1 be the regular expression 1* 0 1* 0 1* 0 1* 0 1*\n",
|
||||||
|
"# Let R2 be the regular expression 0* (1 ∪ ε) 0* (1 ∪ ε) 0* (1 ∪ ε) 0* (1 ∪ ε) 0*\n",
|
||||||
|
"# Let R3 be the regular expression (0 ∪ 1)* 00 (0 ∪ 1)\n",
|
||||||
|
"# Was not supposed to be accepted by all, only bt 2 and 3\n",
|
||||||
|
"r1 = '1*01*01*01*01*'\n",
|
||||||
|
"r2 = '0*(1|())0*(1|())0*(1|())0*(1|())0*'\n",
|
||||||
|
"r3 = '(0|1)*00(0|1)'\n",
|
||||||
|
"inputs = ['00100']\n",
|
||||||
|
"if debug:\n",
|
||||||
|
" regex_test(r1, inputs)\n",
|
||||||
|
" regex_test(r2, inputs)\n",
|
||||||
|
" regex_test(r3, inputs)\n",
|
||||||
|
"Math(latexify(inputs[0]))"
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false,
|
||||||
|
"ExecuteTime": {
|
||||||
|
"end_time": "2024-03-22T22:22:26.547221Z",
|
||||||
|
"start_time": "2024-03-22T22:22:26.539392Z"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"id": "e3c432e6556167c7",
|
||||||
|
"execution_count": 7
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"source": [
|
||||||
|
"$\\pagebreak$"
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false
|
||||||
|
},
|
||||||
|
"id": "77d9bf7018723f74"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"source": [
|
||||||
|
"# Question 33"
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false
|
||||||
|
},
|
||||||
|
"id": "afd92f4bb203df3a"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"p: True\n",
|
||||||
|
"cp: True\n",
|
||||||
|
"pc: True\n",
|
||||||
|
"cpc: True\n",
|
||||||
|
"ccpcc: True\n",
|
||||||
|
"ccpccpcc: True\n",
|
||||||
|
"ccpccpccpcc: True\n",
|
||||||
|
"ccpccpccpccpcc: True\n",
|
||||||
|
"cpcpcpcpcpc: True\n",
|
||||||
|
"pp: True\n"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"text/plain": "<IPython.core.display.Math object>",
|
||||||
|
"text/latex": "$\\displaystyle \\left(c^*pc^*\\right)^*$"
|
||||||
|
},
|
||||||
|
"execution_count": 8,
|
||||||
|
"metadata": {},
|
||||||
|
"output_type": "execute_result"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"# Define a regex where no p is touching another p, and any number of c's can be between any two p's\n",
|
||||||
|
"q33 = '(c*pc*)*'\n",
|
||||||
|
"inputs = [\n",
|
||||||
|
" 'p',\n",
|
||||||
|
" 'cp',\n",
|
||||||
|
" 'pc',\n",
|
||||||
|
" 'cpc',\n",
|
||||||
|
" 'ccpcc',\n",
|
||||||
|
" 'ccpccpcc',\n",
|
||||||
|
" 'ccpccpccpcc',\n",
|
||||||
|
" 'ccpccpccpccpcc',\n",
|
||||||
|
" 'cpcpcpcpcpc',\n",
|
||||||
|
" 'pp', # Not supposed to be here\n",
|
||||||
|
"]\n",
|
||||||
|
"if debug:\n",
|
||||||
|
" regex_test(q33, inputs)\n",
|
||||||
|
"Math(latexify(q33))"
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false,
|
||||||
|
"ExecuteTime": {
|
||||||
|
"end_time": "2024-03-22T22:22:26.555155Z",
|
||||||
|
"start_time": "2024-03-22T22:22:26.549229Z"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"id": "5b8c9ad34523ea81",
|
||||||
|
"execution_count": 8
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"source": [
|
||||||
|
"$\\pagebreak$"
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false
|
||||||
|
},
|
||||||
|
"id": "567a0f904e3a8b66"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"source": [
|
||||||
|
"# Question 34"
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false
|
||||||
|
},
|
||||||
|
"id": "8580d9b65031d9f7"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"0: True\n",
|
||||||
|
"1: True\n",
|
||||||
|
"00: True\n",
|
||||||
|
"01: True\n",
|
||||||
|
"10: True\n",
|
||||||
|
"11: True\n",
|
||||||
|
"000: False\n",
|
||||||
|
"001: False\n",
|
||||||
|
"010: False\n",
|
||||||
|
"0000: True\n",
|
||||||
|
"00001: True\n",
|
||||||
|
"001100: False\n",
|
||||||
|
"011001110: False\n"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"text/plain": "<IPython.core.display.Math object>",
|
||||||
|
"text/latex": "$\\displaystyle \\left(\\left(0\\cup1\\right)\\left(0\\cup1\\right)\\left(0\\cup1\\right)\\right)^*\\left(\\left(0\\cup1\\right)\\cup\\left(00\\cup01\\cup10\\cup11\\right)\\right)$"
|
||||||
|
},
|
||||||
|
"execution_count": 9,
|
||||||
|
"metadata": {},
|
||||||
|
"output_type": "execute_result"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"# Define a regex where the length of the string is not a multiple of 3, on input {0, 1}\n",
|
||||||
|
"q34 = '((0|1)(0|1)(0|1))*((0|1)|(00|01|10|11))'\n",
|
||||||
|
"inputs = [\n",
|
||||||
|
" '0', # 1\n",
|
||||||
|
" '1', # 1\n",
|
||||||
|
" '00', # 2\n",
|
||||||
|
" '01', # 2\n",
|
||||||
|
" '10', # 2 \n",
|
||||||
|
" '11', # 2\n",
|
||||||
|
" '000', # 3\n",
|
||||||
|
" '001', # 3\n",
|
||||||
|
" '010', # 3\n",
|
||||||
|
" '0000', # 4\n",
|
||||||
|
" '00001', # 5\n",
|
||||||
|
" '001100', # 6\n",
|
||||||
|
" '011001110', # 9\n",
|
||||||
|
"]\n",
|
||||||
|
"if debug:\n",
|
||||||
|
" regex_test(q34, inputs)\n",
|
||||||
|
"Math(latexify(q34))"
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false,
|
||||||
|
"ExecuteTime": {
|
||||||
|
"end_time": "2024-03-22T22:22:26.563180Z",
|
||||||
|
"start_time": "2024-03-22T22:22:26.556508Z"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"id": "6aa37e012a2b072d",
|
||||||
|
"execution_count": 9
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"source": [
|
||||||
|
"$\\pagebreak$"
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false
|
||||||
|
},
|
||||||
|
"id": "28524e4a3d3c6e8e"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"source": [
|
||||||
|
"# Question 35\n",
|
||||||
|
"## a.\n",
|
||||||
|
"$$L = \\{ w \\in \\{ 0, 1 \\}^* \\ | n_0(w) \\text{ is a multiple of } 4 \\}$$\n",
|
||||||
|
"\n",
|
||||||
|
"## b.\n",
|
||||||
|
"$$L = \\{ a^x b^y c^z \\ | x \\geq 1, y \\geq 2, z \\geq 3 \\}$$"
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false
|
||||||
|
},
|
||||||
|
"id": "1f0065878ddf68f8"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"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
|
||||||
|
}
|
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
|
||||||
|
}
|
135
Assignment 7.ipynb
Normal file
135
Assignment 7.ipynb
Normal file
@ -0,0 +1,135 @@
|
|||||||
|
{
|
||||||
|
"cells": [
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "a90ef9f8022df10e",
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false
|
||||||
|
},
|
||||||
|
"source": [
|
||||||
|
"# Question 42\n",
|
||||||
|
"## c.\n",
|
||||||
|
"$$S \\rightarrow 0S0 | 0S1 | 1S0 | 1S1 | 1$$\n",
|
||||||
|
"\n",
|
||||||
|
"## d.\n",
|
||||||
|
"$$S \\rightarrow X | \\epsilon$$\n",
|
||||||
|
"$$X \\rightarrow aXdd | Y$$\n",
|
||||||
|
"$$Y \\rightarrow bYd | Z$$\n",
|
||||||
|
"$$Z \\rightarrow cZ | \\epsilon$$\n",
|
||||||
|
"\n",
|
||||||
|
"## e.\n",
|
||||||
|
"$$S \\rightarrow 0S | 1S | 00S | 01S | 10S | 11S | 000S | 001S | 010S | 011S| 100S | 101S | 111S | \\epsilon$$"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "2d1690ef",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"$\\pagebreak$"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "9a7c595f",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"# Question 43\n",
|
||||||
|
"## a.\n",
|
||||||
|
"$$B = \\{ w \\in \\{a, b, c\\}^* | |w| = 4n+1, n \\in \\mathbb{Z}^{\\text{nonneg}} \\}$$\n",
|
||||||
|
"\n",
|
||||||
|
"## b.\n",
|
||||||
|
"$$B = \\{ 0^2x1^3y+2 | x, y \\in \\mathbb{Z}^{\\text{nonneg}} \\}$$\n",
|
||||||
|
"\n",
|
||||||
|
"## c.\n",
|
||||||
|
"$$B = \\{ 0^x1^y | x \\neq y \\text{ and } x, y \\in \\mathbb{Z}^{\\text{nonneg}} \\}$$"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "c8d0ce5a",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"$\\pagebreak$"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "8d439d76",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"# Question 44\n",
|
||||||
|
"## a.\n",
|
||||||
|
"$$B = \\{ 0^x1^y | y = x + 1 \\text{ and } x, y \\in \\mathbb{Z}^{\\text{nonneg}} \\}$$\n",
|
||||||
|
"\n",
|
||||||
|
"## c.\n",
|
||||||
|
"$$B = \\{ 0^x1^y | y = 3x \\text{ and } x, y \\in \\mathbb{Z}^{\\text{nonneg}} \\}$$"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "323bea35",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"$\\pagebreak$"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "56466c7f",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"# Question 45\n",
|
||||||
|
"1. First the machine should move left to right looking for a \"b\". If it does not find one it moves to the reject state and if it finds one it will:\n",
|
||||||
|
" - Erase the \"b\"\n",
|
||||||
|
" - Move back to the start\n",
|
||||||
|
" - Look for an \"a\". If it finds one it will repeat step 1. If it does not find one, it will move to the accept state"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"metadata": {},
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"source": "$\\pagebreak$",
|
||||||
|
"id": "e9fba2ef63041f08"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"metadata": {},
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"source": [
|
||||||
|
"# Question 47\n",
|
||||||
|
"1. First the machine should check if the length of the string is at least 6 and if not, reject\n",
|
||||||
|
"2. Copy 0 or more symbols to tape 2 from tape 1\n",
|
||||||
|
"3. Erase all of tape 2\n",
|
||||||
|
"4. Copy 3 symbols to tape 2 from tape 1\n",
|
||||||
|
"5. Copy 0 or more symbols to tape 3 from tape 1\n",
|
||||||
|
"6. Erase of all of tape 3\n",
|
||||||
|
"7. Copy 3 symbols to tape 3 from tape 1\n",
|
||||||
|
"8. Compare tapes 2 and 3 and if they match, accept, otherwise reject\n",
|
||||||
|
"\n",
|
||||||
|
"The nondeterminism of this machine is the copying 0 or more symbols, as this accounts for strings u and x, as they can be any length including 0, and the machine can make a choice of 0 or more."
|
||||||
|
],
|
||||||
|
"id": "7b6c771c1004546f"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"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
|
||||||
|
}
|
61
Assignment 8.ipynb
Normal file
61
Assignment 8.ipynb
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
{
|
||||||
|
"cells": [
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "a90ef9f8022df10e",
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false
|
||||||
|
},
|
||||||
|
"source": [
|
||||||
|
"# Question 48\n",
|
||||||
|
"Given that $A_{DFA}$ is decidable, and it will finish in a finite number of steps, we know that any DFA that accepts at least one string of finite length 3, we know that it is decidable. The algorithm is as follows:\n",
|
||||||
|
"\n",
|
||||||
|
"1. Start in M's start state\n",
|
||||||
|
"2. Go through the symbols of w one at a time\n",
|
||||||
|
"3. For all symbols of length 3, and the DFA is an accept state, we accept M DFA, otherwise reject M"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "2d1690ef",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"$\\pagebreak$"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "9a7c595f",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"# Question 49\n",
|
||||||
|
"Let us assume that $EQ_{TM}$ is decidable, then we can:\n",
|
||||||
|
"\n",
|
||||||
|
"1. Pass two copies of $ALL_{TM}$ into $EQ_{TM}$\n",
|
||||||
|
"2. If $EQ_{TM}$ accepts the two copies of $ALL_{TM}$, this means that $ALL_{TM}$ is decidable, as $EQ_{TM}$ must decide on $ALL_{TM}$\n",
|
||||||
|
"3. Therefor it is impossible for $EQ_{TM}$ to be decidable given that $ALL_{TM}$ is undecidable"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"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
|
||||||
|
}
|
BIN
Drawing/A3.xcf
Normal file
BIN
Drawing/A3.xcf
Normal file
Binary file not shown.
BIN
Drawing/A4.xcf
Normal file
BIN
Drawing/A4.xcf
Normal file
Binary file not shown.
3
freeze.sh
Normal file
3
freeze.sh
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
source ~/.virtualenvs/CS2333/bin/activate
|
||||||
|
pip freeze > requirements.txt
|
104
requirements.txt
Normal file
104
requirements.txt
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
anyio==4.2.0
|
||||||
|
argon2-cffi==23.1.0
|
||||||
|
argon2-cffi-bindings==21.2.0
|
||||||
|
arrow==1.3.0
|
||||||
|
asttokens==2.4.1
|
||||||
|
async-lru==2.0.4
|
||||||
|
attrs==23.2.0
|
||||||
|
automata-lib==8.2.0
|
||||||
|
Babel==2.14.0
|
||||||
|
beautifulsoup4==4.12.3
|
||||||
|
bleach==6.1.0
|
||||||
|
cached_method==0.1.0
|
||||||
|
certifi==2023.11.17
|
||||||
|
cffi==1.16.0
|
||||||
|
charset-normalizer==3.3.2
|
||||||
|
coloraide==2.16
|
||||||
|
comm==0.2.1
|
||||||
|
debugpy==1.8.0
|
||||||
|
decorator==5.1.1
|
||||||
|
defusedxml==0.7.1
|
||||||
|
exceptiongroup==1.2.0
|
||||||
|
executing==2.0.1
|
||||||
|
fastjsonschema==2.19.1
|
||||||
|
fqdn==1.5.1
|
||||||
|
frozendict==2.4.0
|
||||||
|
idna==3.6
|
||||||
|
importlib-metadata==7.0.1
|
||||||
|
ipykernel==6.29.0
|
||||||
|
ipython==8.18.1
|
||||||
|
ipywidgets==8.1.1
|
||||||
|
isoduration==20.11.0
|
||||||
|
jedi==0.19.1
|
||||||
|
Jinja2==3.1.3
|
||||||
|
json5==0.9.14
|
||||||
|
jsonpointer==2.4
|
||||||
|
jsonschema==4.21.1
|
||||||
|
jsonschema-specifications==2023.12.1
|
||||||
|
jupyter==1.0.0
|
||||||
|
jupyter-console==6.6.3
|
||||||
|
jupyter-events==0.9.0
|
||||||
|
jupyter-lsp==2.2.2
|
||||||
|
jupyter_client==8.6.0
|
||||||
|
jupyter_core==5.7.1
|
||||||
|
jupyter_server==2.12.5
|
||||||
|
jupyter_server_terminals==0.5.2
|
||||||
|
jupyterlab==4.0.11
|
||||||
|
jupyterlab-widgets==3.0.9
|
||||||
|
jupyterlab_pygments==0.3.0
|
||||||
|
jupyterlab_server==2.25.2
|
||||||
|
MarkupSafe==2.1.4
|
||||||
|
matplotlib-inline==0.1.6
|
||||||
|
mistune==3.0.2
|
||||||
|
nbclient==0.9.0
|
||||||
|
nbconvert==7.14.2
|
||||||
|
nbformat==5.9.2
|
||||||
|
nest-asyncio==1.6.0
|
||||||
|
networkx==3.2.1
|
||||||
|
notebook==7.0.7
|
||||||
|
notebook_shim==0.2.3
|
||||||
|
overrides==7.6.0
|
||||||
|
packaging==23.2
|
||||||
|
pandocfilters==1.5.1
|
||||||
|
parso==0.8.3
|
||||||
|
pexpect==4.9.0
|
||||||
|
platformdirs==4.1.0
|
||||||
|
prometheus-client==0.19.0
|
||||||
|
prompt-toolkit==3.0.43
|
||||||
|
psutil==5.9.8
|
||||||
|
ptyprocess==0.7.0
|
||||||
|
pure-eval==0.2.2
|
||||||
|
pycparser==2.21
|
||||||
|
Pygments==2.17.2
|
||||||
|
pygraphviz==1.11
|
||||||
|
python-dateutil==2.8.2
|
||||||
|
python-json-logger==2.0.7
|
||||||
|
PyYAML==6.0.1
|
||||||
|
pyzmq==25.1.2
|
||||||
|
qtconsole==5.5.1
|
||||||
|
QtPy==2.4.1
|
||||||
|
referencing==0.32.1
|
||||||
|
requests==2.31.0
|
||||||
|
rfc3339-validator==0.1.4
|
||||||
|
rfc3986-validator==0.1.1
|
||||||
|
rpds-py==0.17.1
|
||||||
|
Send2Trash==1.8.2
|
||||||
|
six==1.16.0
|
||||||
|
sniffio==1.3.0
|
||||||
|
soupsieve==2.5
|
||||||
|
stack-data==0.6.3
|
||||||
|
terminado==0.18.0
|
||||||
|
tinycss2==1.2.1
|
||||||
|
tomli==2.0.1
|
||||||
|
tornado==6.4
|
||||||
|
traitlets==5.14.1
|
||||||
|
types-python-dateutil==2.8.19.20240106
|
||||||
|
typing_extensions==4.9.0
|
||||||
|
uri-template==1.3.0
|
||||||
|
urllib3==2.1.0
|
||||||
|
wcwidth==0.2.13
|
||||||
|
webcolors==1.13
|
||||||
|
webencodings==0.5.1
|
||||||
|
websocket-client==1.7.0
|
||||||
|
widgetsnbextension==4.0.9
|
||||||
|
zipp==3.17.0
|
Reference in New Issue
Block a user