Compare commits
No commits in common. "20fdb9413d0cce8d464dea92c7a146744fba0f1c" and "65f5adc2aca1ced0a35f3b2b82ad9296db7d9f4e" have entirely different histories.
20fdb9413d
...
65f5adc2ac
@ -1,6 +1,6 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Export A1" type="ShConfigurationType">
|
||||
<option name="SCRIPT_TEXT" value="jupyter-nbconvert.exe "Assignment 1.ipynb" --to webpdf" />
|
||||
<option name="SCRIPT_TEXT" value="jupyter-nbconvert.exe "Assignment 1.ipynb" --to webpdf --no-input" />
|
||||
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
|
||||
<option name="SCRIPT_PATH" value="" />
|
||||
<option name="SCRIPT_OPTIONS" value="" />
|
||||
|
@ -1,17 +0,0 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Export A1 No Code" type="ShConfigurationType">
|
||||
<option name="SCRIPT_TEXT" value="jupyter-nbconvert.exe "Assignment 1.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>
|
@ -19,36 +19,16 @@
|
||||
"metadata": {
|
||||
"collapsed": false,
|
||||
"ExecuteTime": {
|
||||
"end_time": "2024-01-18T21:45:24.278399500Z",
|
||||
"start_time": "2024-01-18T21:45:24.273024200Z"
|
||||
"end_time": "2024-01-18T20:59:35.482159200Z",
|
||||
"start_time": "2024-01-18T20:59:35.470889900Z"
|
||||
}
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Helper functions\n",
|
||||
"def get_all_strings_with_a_given_alphabet_and_length(_alphabet, _length):\n",
|
||||
"\t_strings = ['']\n",
|
||||
"\tfor itr in range(_length):\n",
|
||||
"\t\t_string = [s + c for s in _strings for c in _alphabet]\n",
|
||||
"\t\t_strings += _string\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",
|
||||
"\n",
|
||||
"def replace_empty_string_with_symbol(_strings):\n",
|
||||
"\tsymbol = 'ε'\n",
|
||||
"\tfor itr in range(len(_strings)):\n",
|
||||
"\t\tif _strings[itr] == '':\n",
|
||||
"\t\t\t_strings[itr] = symbol\n",
|
||||
"\treturn _strings\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"def print_strings(_strings):\n",
|
||||
"\t_strings = replace_empty_string_with_symbol(_strings)\n",
|
||||
"\t# print(len(strings))\n",
|
||||
"\tprint(_strings)"
|
||||
"# util contains functions that make it easier to form strings \n",
|
||||
"# from languages, and give output that matches with expected \n",
|
||||
"# output for the homework, (replace empty string with epsilon)\n",
|
||||
"from util import *"
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -79,8 +59,8 @@
|
||||
"metadata": {
|
||||
"collapsed": false,
|
||||
"ExecuteTime": {
|
||||
"end_time": "2024-01-18T21:45:24.284569900Z",
|
||||
"start_time": "2024-01-18T21:45:24.278399500Z"
|
||||
"end_time": "2024-01-18T20:59:35.494611400Z",
|
||||
"start_time": "2024-01-18T20:59:35.477374Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
@ -124,8 +104,8 @@
|
||||
"metadata": {
|
||||
"collapsed": false,
|
||||
"ExecuteTime": {
|
||||
"end_time": "2024-01-18T21:45:24.288935300Z",
|
||||
"start_time": "2024-01-18T21:45:24.286415200Z"
|
||||
"end_time": "2024-01-18T20:59:35.536014100Z",
|
||||
"start_time": "2024-01-18T20:59:35.486263100Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
@ -168,8 +148,8 @@
|
||||
"metadata": {
|
||||
"collapsed": false,
|
||||
"ExecuteTime": {
|
||||
"end_time": "2024-01-18T21:45:24.296122800Z",
|
||||
"start_time": "2024-01-18T21:45:24.289936100Z"
|
||||
"end_time": "2024-01-18T20:59:35.536014100Z",
|
||||
"start_time": "2024-01-18T20:59:35.491094800Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
@ -210,8 +190,8 @@
|
||||
"metadata": {
|
||||
"collapsed": false,
|
||||
"ExecuteTime": {
|
||||
"end_time": "2024-01-18T21:45:24.298113500Z",
|
||||
"start_time": "2024-01-18T21:45:24.293966900Z"
|
||||
"end_time": "2024-01-18T20:59:35.539017300Z",
|
||||
"start_time": "2024-01-18T20:59:35.497609900Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
@ -261,8 +241,8 @@
|
||||
"metadata": {
|
||||
"collapsed": false,
|
||||
"ExecuteTime": {
|
||||
"end_time": "2024-01-18T21:45:24.340947500Z",
|
||||
"start_time": "2024-01-18T21:45:24.299113600Z"
|
||||
"end_time": "2024-01-18T20:59:35.581083800Z",
|
||||
"start_time": "2024-01-18T20:59:35.542564Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
@ -302,8 +282,8 @@
|
||||
"metadata": {
|
||||
"collapsed": false,
|
||||
"ExecuteTime": {
|
||||
"end_time": "2024-01-18T21:45:24.341947200Z",
|
||||
"start_time": "2024-01-18T21:45:24.303632300Z"
|
||||
"end_time": "2024-01-18T20:59:35.594528300Z",
|
||||
"start_time": "2024-01-18T20:59:35.585083400Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
@ -351,8 +331,8 @@
|
||||
"metadata": {
|
||||
"collapsed": false,
|
||||
"ExecuteTime": {
|
||||
"end_time": "2024-01-18T21:45:24.341947200Z",
|
||||
"start_time": "2024-01-18T21:45:24.307343300Z"
|
||||
"end_time": "2024-01-18T20:59:35.649706300Z",
|
||||
"start_time": "2024-01-18T20:59:35.597530600Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
@ -412,8 +392,8 @@
|
||||
"metadata": {
|
||||
"collapsed": false,
|
||||
"ExecuteTime": {
|
||||
"end_time": "2024-01-18T21:45:24.342947100Z",
|
||||
"start_time": "2024-01-18T21:45:24.314341500Z"
|
||||
"end_time": "2024-01-18T20:59:35.650706300Z",
|
||||
"start_time": "2024-01-18T20:59:35.603524100Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
@ -481,8 +461,8 @@
|
||||
"metadata": {
|
||||
"collapsed": false,
|
||||
"ExecuteTime": {
|
||||
"end_time": "2024-01-18T21:45:24.342947100Z",
|
||||
"start_time": "2024-01-18T21:45:24.317844500Z"
|
||||
"end_time": "2024-01-18T20:59:35.652706Z",
|
||||
"start_time": "2024-01-18T20:59:35.612375700Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
@ -531,8 +511,8 @@
|
||||
"metadata": {
|
||||
"collapsed": false,
|
||||
"ExecuteTime": {
|
||||
"end_time": "2024-01-18T21:45:24.342947100Z",
|
||||
"start_time": "2024-01-18T21:45:24.323363100Z"
|
||||
"end_time": "2024-01-18T20:59:35.691666Z",
|
||||
"start_time": "2024-01-18T20:59:35.656707400Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
|
Loading…
Reference in New Issue
Block a user