Rephrase q3
This commit is contained in:
parent
fd4359943e
commit
cec9e9104f
@ -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": [
|
||||||
|
Loading…
Reference in New Issue
Block a user