<div class="xblock xblock-public_view xblock-public_view-vertical" data-course-id="course-v1:OCW+6.042J+2T2019" data-runtime-class="LmsRuntime" data-request-token="a478a16ae12211ef932116ffeba94eb7" data-block-type="vertical" data-graded="False" data-runtime-version="1" data-init="VerticalStudentView" data-has-score="False" data-usage-id="block-v1:OCW+6.042J+2T2019+type@vertical+block@6d4ecece40664dccb2fe4a320298f212">
<h2 class="hd hd-2 unit-title">Introduction</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:OCW+6.042J+2T2019+type@html+block@85d4b476adf0477f9f7c9955096e4fa6">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-course-id="course-v1:OCW+6.042J+2T2019" data-runtime-class="LmsRuntime" data-request-token="a478a16ae12211ef932116ffeba94eb7" data-block-type="html" data-graded="False" data-runtime-version="1" data-init="XBlockToXModuleShim" data-has-score="False" data-usage-id="block-v1:OCW+6.042J+2T2019+type@html+block@85d4b476adf0477f9f7c9955096e4fa6">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<p>Read <a href="/assets/courseware/v1/3d66c5674cdf557081ff5baf836eb321/asset-v1:OCW+6.042J+2T2019+type@asset+block/MIT6_042JS15_Session9.pdf" target="[object Object]">Chapter 5.4 (PDF) </a>of <em>Mathematics for Computer Science</em> for 1.9 State Machines - Invariants.</p>
<p>View the <a href="/assets/courseware/v1/f23aa2c4f34101bde4851e022006774c/asset-v1:OCW+6.042J+2T2019+type@asset+block/MIT6_042JS15_cp9.pdf" target="[object Object]">Section 1.9 In-Class Questions (PDF)</a></p>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-course-id="course-v1:OCW+6.042J+2T2019" data-runtime-class="LmsRuntime" data-request-token="a478a16ae12211ef932116ffeba94eb7" data-block-type="vertical" data-graded="False" data-runtime-version="1" data-init="VerticalStudentView" data-has-score="False" data-usage-id="block-v1:OCW+6.042J+2T2019+type@vertical+block@63d2b4f4618d498998320aff0bf68f30">
<h2 class="hd hd-2 unit-title">Lecture Video | State Machines Invariants</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:OCW+6.042J+2T2019+type@video+block@6ea6bd37310c40c886f57ddf7383373d">
<div class="xblock xblock-public_view xblock-public_view-video xmodule_display xmodule_VideoBlock" data-course-id="course-v1:OCW+6.042J+2T2019" data-runtime-class="LmsRuntime" data-request-token="a478a16ae12211ef932116ffeba94eb7" data-block-type="video" data-graded="False" data-runtime-version="1" data-init="XBlockToXModuleShim" data-has-score="False" data-usage-id="block-v1:OCW+6.042J+2T2019+type@video+block@6ea6bd37310c40c886f57ddf7383373d">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Video"}
</script>
<h3 class="hd hd-2">State Machine Invariants</h3>
<div
id="video_6ea6bd37310c40c886f57ddf7383373d"
class="video closed"
data-metadata='{"streams": "1.00:VuG2JNcRXYg", "autohideHtml5": false, "autoplay": false, "transcriptTranslationUrl": "/courses/course-v1:OCW+6.042J+2T2019/xblock/block-v1:OCW+6.042J+2T2019+type@video+block@6ea6bd37310c40c886f57ddf7383373d/handler/transcript/translation/__lang__", "transcriptLanguage": "en", "publishCompletionUrl": "/courses/course-v1:OCW+6.042J+2T2019/xblock/block-v1:OCW+6.042J+2T2019+type@video+block@6ea6bd37310c40c886f57ddf7383373d/handler/publish_completion", "transcriptAvailableTranslationsUrl": "/courses/course-v1:OCW+6.042J+2T2019/xblock/block-v1:OCW+6.042J+2T2019+type@video+block@6ea6bd37310c40c886f57ddf7383373d/handler/transcript/available_translations", "completionEnabled": false, "generalSpeed": 1.0, "ytTestTimeout": 1500, "ytMetadataEndpoint": "", "ytApiUrl": "https://www.youtube.com/iframe_api", "showCaptions": "true", "recordedYoutubeIsAvailable": true, "sources": ["https://ia800207.us.archive.org/32/items/MIT6.042JS15/MIT6_042JS15_statemachines_ipod.mp4"], "end": 0.0, "saveStateEnabled": false, "prioritizeHls": false, "savedVideoPosition": 0.0, "captionDataDir": null, "transcriptLanguages": {"en": "English"}, "start": 0.0, "saveStateUrl": "/courses/course-v1:OCW+6.042J+2T2019/xblock/block-v1:OCW+6.042J+2T2019+type@video+block@6ea6bd37310c40c886f57ddf7383373d/handler/xmodule_handler/save_user_state", "speed": null, "autoAdvance": false, "completionPercentage": 0.95, "duration": 0.0, "lmsRootURL": "https://openlearninglibrary.mit.edu", "poster": null}'
data-bumper-metadata='null'
data-autoadvance-enabled="False"
data-poster='null'
tabindex="-1"
>
<div class="focus_grabber first"></div>
<div class="tc-wrapper">
<div class="video-wrapper">
<span tabindex="0" class="spinner" aria-hidden="false" aria-label="Loading video player"></span>
<span tabindex="-1" class="btn-play fa fa-youtube-play fa-2x is-hidden" aria-hidden="true" aria-label="Play video"></span>
<div class="video-player-pre"></div>
<div class="video-player">
<div id="6ea6bd37310c40c886f57ddf7383373d"></div>
<h4 class="hd hd-4 video-error is-hidden">No playable video sources found.</h4>
<h4 class="hd hd-4 video-hls-error is-hidden">
Your browser does not support this video format. Try using a different browser.
</h4>
</div>
<div class="video-player-post"></div>
<div class="closed-captions"></div>
<div class="video-controls is-hidden">
<div>
<div class="vcr"><div class="vidtime">0:00 / 0:00</div></div>
<div class="secondary-controls"></div>
</div>
</div>
</div>
</div>
<div class="focus_grabber last"></div>
<h3 class="hd hd-4 downloads-heading sr" id="video-download-transcripts_6ea6bd37310c40c886f57ddf7383373d">Downloads and transcripts</h3>
<div class="wrapper-downloads" role="region" aria-labelledby="video-download-transcripts_6ea6bd37310c40c886f57ddf7383373d">
<div class="wrapper-download-video">
<h4 class="hd hd-5">Video</h4>
<a class="btn-link video-sources video-download-button" href="https://ia800207.us.archive.org/32/items/MIT6.042JS15/MIT6_042JS15_statemachines_ipod.mp4">
Download video file
</a>
</div>
<div class="wrapper-download-transcripts">
<h4 class="hd hd-5">Transcripts</h4>
<ul class="list-download-transcripts">
<li class="transcript-option">
<a class="btn btn-link" href="/courses/course-v1:OCW+6.042J+2T2019/xblock/block-v1:OCW+6.042J+2T2019+type@video+block@6ea6bd37310c40c886f57ddf7383373d/handler/transcript/download" data-value="srt">Download SubRip (.srt) file</a>
</li>
<li class="transcript-option">
<a class="btn btn-link" href="/courses/course-v1:OCW+6.042J+2T2019/xblock/block-v1:OCW+6.042J+2T2019+type@video+block@6ea6bd37310c40c886f57ddf7383373d/handler/transcript/download" data-value="txt">Download Text (.txt) file</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:OCW+6.042J+2T2019+type@html+block@90c4d91bc38342e9a33c1a9d865dbbc1">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-course-id="course-v1:OCW+6.042J+2T2019" data-runtime-class="LmsRuntime" data-request-token="a478a16ae12211ef932116ffeba94eb7" data-block-type="html" data-graded="False" data-runtime-version="1" data-init="XBlockToXModuleShim" data-has-score="False" data-usage-id="block-v1:OCW+6.042J+2T2019+type@html+block@90c4d91bc38342e9a33c1a9d865dbbc1">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<p>Download a copy of the slides for <a href="/assets/courseware/v1/01b15a9a21796c78e4ef15a368880fa9/asset-v1:OCW+6.042J+2T2019+type@asset+block/MIT6_042JS16_StateMachine.pdf" target="[object Object]">State Machine Invariants (PDF)</a></p>
<p><a href="/assets/courseware/v1/a2bef06ec5748df73dd92792c5e2ea5e/asset-v1:OCW+6.042J+2T2019+type@asset+block/StateMach_1.9_Lectrans.pdf" target="[object Object]">Lecture video transcript (PDF)</a></p>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-course-id="course-v1:OCW+6.042J+2T2019" data-runtime-class="LmsRuntime" data-request-token="a478a16ae12211ef932116ffeba94eb7" data-block-type="vertical" data-graded="False" data-runtime-version="1" data-init="VerticalStudentView" data-has-score="False" data-usage-id="block-v1:OCW+6.042J+2T2019+type@vertical+block@17a57ce13f4546999faf5eaf3ca5987a">
<h2 class="hd hd-2 unit-title">Exercise | State Machine Invariants</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:OCW+6.042J+2T2019+type@problem+block@4bb1f55ed1164be2a32fbd938afd66fc">
<div class="xblock xblock-public_view xblock-public_view-problem xmodule_display xmodule_ProblemBlock" data-course-id="course-v1:OCW+6.042J+2T2019" data-runtime-class="LmsRuntime" data-request-token="a478a16ae12211ef932116ffeba94eb7" data-block-type="problem" data-graded="False" data-runtime-version="1" data-init="XBlockToXModuleShim" data-has-score="True" data-usage-id="block-v1:OCW+6.042J+2T2019+type@problem+block@4bb1f55ed1164be2a32fbd938afd66fc">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Problem"}
</script>
<div id="problem_4bb1f55ed1164be2a32fbd938afd66fc" class="problems-wrapper" role="group"
aria-labelledby="4bb1f55ed1164be2a32fbd938afd66fc-problem-title"
data-problem-id="block-v1:OCW+6.042J+2T2019+type@problem+block@4bb1f55ed1164be2a32fbd938afd66fc" data-url="/courses/course-v1:OCW+6.042J+2T2019/xblock/block-v1:OCW+6.042J+2T2019+type@problem+block@4bb1f55ed1164be2a32fbd938afd66fc/handler/xmodule_handler"
data-problem-score="0"
data-problem-total-possible="4"
data-attempts-used="0"
data-content="
<h3 class="hd hd-3 problem-header" id="4bb1f55ed1164be2a32fbd938afd66fc-problem-title" aria-describedby="block-v1:OCW+6.042J+2T2019+type@problem+block@4bb1f55ed1164be2a32fbd938afd66fc-problem-progress" tabindex="-1">
State Machine Invariants
</h3>
<div class="problem-progress" id="block-v1:OCW+6.042J+2T2019+type@problem+block@4bb1f55ed1164be2a32fbd938afd66fc-problem-progress"></div>
<div class="problem">
<div>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 1" role="group"><p> 1. What are the states in the <em>Die Hard</em> example?</p>
<div class="choicegroup capa_inputtype" id="inputtype_4bb1f55ed1164be2a32fbd938afd66fc_2_1">
<fieldset aria-describedby="status_4bb1f55ed1164be2a32fbd938afd66fc_2_1">
<div class="field">
<input type="radio" name="input_4bb1f55ed1164be2a32fbd938afd66fc_2_1" id="input_4bb1f55ed1164be2a32fbd938afd66fc_2_1_choice_0" class="field-input input-radio" value="choice_0"/><label id="4bb1f55ed1164be2a32fbd938afd66fc_2_1-choice_0-label" for="input_4bb1f55ed1164be2a32fbd938afd66fc_2_1_choice_0" class="response-label field-label label-inline" aria-describedby="status_4bb1f55ed1164be2a32fbd938afd66fc_2_1"> The total amount of water in two jugs
</label>
</div>
<div class="field">
<input type="radio" name="input_4bb1f55ed1164be2a32fbd938afd66fc_2_1" id="input_4bb1f55ed1164be2a32fbd938afd66fc_2_1_choice_1" class="field-input input-radio" value="choice_1"/><label id="4bb1f55ed1164be2a32fbd938afd66fc_2_1-choice_1-label" for="input_4bb1f55ed1164be2a32fbd938afd66fc_2_1_choice_1" class="response-label field-label label-inline" aria-describedby="status_4bb1f55ed1164be2a32fbd938afd66fc_2_1"> The amount of water in jugs: <math xmlns="http://www.w3.org/1998/Math/MathML">
<mo stretchy="false">(</mo>
<mi>b</mi>
<mo>,</mo>
<mi>l</mi>
<mo stretchy="false">)</mo>
</math> , where <math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>b</mi>
</math> is the amount in the big jug, <math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>l</mi>
</math> is the amount in the small jug
</label>
</div>
<div class="field">
<input type="radio" name="input_4bb1f55ed1164be2a32fbd938afd66fc_2_1" id="input_4bb1f55ed1164be2a32fbd938afd66fc_2_1_choice_2" class="field-input input-radio" value="choice_2"/><label id="4bb1f55ed1164be2a32fbd938afd66fc_2_1-choice_2-label" for="input_4bb1f55ed1164be2a32fbd938afd66fc_2_1_choice_2" class="response-label field-label label-inline" aria-describedby="status_4bb1f55ed1164be2a32fbd938afd66fc_2_1"> The difference in the amount of water in two jugs
</label>
</div>
<div class="field">
<input type="radio" name="input_4bb1f55ed1164be2a32fbd938afd66fc_2_1" id="input_4bb1f55ed1164be2a32fbd938afd66fc_2_1_choice_3" class="field-input input-radio" value="choice_3"/><label id="4bb1f55ed1164be2a32fbd938afd66fc_2_1-choice_3-label" for="input_4bb1f55ed1164be2a32fbd938afd66fc_2_1_choice_3" class="response-label field-label label-inline" aria-describedby="status_4bb1f55ed1164be2a32fbd938afd66fc_2_1"> None of the above
</label>
</div>
<span id="answer_4bb1f55ed1164be2a32fbd938afd66fc_2_1"/>
</fieldset>
<div class="indicator-container">
<span class="status unanswered" id="status_4bb1f55ed1164be2a32fbd938afd66fc_2_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
</div>
</div></div>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 2" role="group"><p> 2. The preserved invariant for the state machine in the <em>Die Hard Once For All</em> example is: </p>
<div class="choicegroup capa_inputtype" id="inputtype_4bb1f55ed1164be2a32fbd938afd66fc_3_1">
<fieldset aria-describedby="status_4bb1f55ed1164be2a32fbd938afd66fc_3_1">
<div class="field">
<input type="radio" name="input_4bb1f55ed1164be2a32fbd938afd66fc_3_1" id="input_4bb1f55ed1164be2a32fbd938afd66fc_3_1_choice_0" class="field-input input-radio" value="choice_0"/><label id="4bb1f55ed1164be2a32fbd938afd66fc_3_1-choice_0-label" for="input_4bb1f55ed1164be2a32fbd938afd66fc_3_1_choice_0" class="response-label field-label label-inline" aria-describedby="status_4bb1f55ed1164be2a32fbd938afd66fc_3_1"> The total amount of water must increase or decrease by exactly three gallons.
</label>
</div>
<div class="field">
<input type="radio" name="input_4bb1f55ed1164be2a32fbd938afd66fc_3_1" id="input_4bb1f55ed1164be2a32fbd938afd66fc_3_1_choice_1" class="field-input input-radio" value="choice_1"/><label id="4bb1f55ed1164be2a32fbd938afd66fc_3_1-choice_1-label" for="input_4bb1f55ed1164be2a32fbd938afd66fc_3_1_choice_1" class="response-label field-label label-inline" aria-describedby="status_4bb1f55ed1164be2a32fbd938afd66fc_3_1"> The total amount of water must be preserved.
</label>
</div>
<div class="field">
<input type="radio" name="input_4bb1f55ed1164be2a32fbd938afd66fc_3_1" id="input_4bb1f55ed1164be2a32fbd938afd66fc_3_1_choice_2" class="field-input input-radio" value="choice_2"/><label id="4bb1f55ed1164be2a32fbd938afd66fc_3_1-choice_2-label" for="input_4bb1f55ed1164be2a32fbd938afd66fc_3_1_choice_2" class="response-label field-label label-inline" aria-describedby="status_4bb1f55ed1164be2a32fbd938afd66fc_3_1"> The number of gallons in each jug is never divisble by the difference of the jugs.
</label>
</div>
<div class="field">
<input type="radio" name="input_4bb1f55ed1164be2a32fbd938afd66fc_3_1" id="input_4bb1f55ed1164be2a32fbd938afd66fc_3_1_choice_3" class="field-input input-radio" value="choice_3"/><label id="4bb1f55ed1164be2a32fbd938afd66fc_3_1-choice_3-label" for="input_4bb1f55ed1164be2a32fbd938afd66fc_3_1_choice_3" class="response-label field-label label-inline" aria-describedby="status_4bb1f55ed1164be2a32fbd938afd66fc_3_1"> The number of gallons in each jug is always divisble by three.
</label>
</div>
<div class="field">
<input type="radio" name="input_4bb1f55ed1164be2a32fbd938afd66fc_3_1" id="input_4bb1f55ed1164be2a32fbd938afd66fc_3_1_choice_4" class="field-input input-radio" value="choice_4"/><label id="4bb1f55ed1164be2a32fbd938afd66fc_3_1-choice_4-label" for="input_4bb1f55ed1164be2a32fbd938afd66fc_3_1_choice_4" class="response-label field-label label-inline" aria-describedby="status_4bb1f55ed1164be2a32fbd938afd66fc_3_1"> The number of gallons in each jug can be any integer value.
</label>
</div>
<span id="answer_4bb1f55ed1164be2a32fbd938afd66fc_3_1"/>
</fieldset>
<div class="indicator-container">
<span class="status unanswered" id="status_4bb1f55ed1164be2a32fbd938afd66fc_3_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
</div>
</div></div>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 3" role="group"><p> 3. Which of the following are valid states for the robot's location in the <em>Diagonal Robot example?</em></p>
<div class="choicegroup capa_inputtype" id="inputtype_4bb1f55ed1164be2a32fbd938afd66fc_4_1">
<fieldset aria-describedby="status_4bb1f55ed1164be2a32fbd938afd66fc_4_1">
<div class="field">
<input type="checkbox" name="input_4bb1f55ed1164be2a32fbd938afd66fc_4_1[]" id="input_4bb1f55ed1164be2a32fbd938afd66fc_4_1_choice_0" class="field-input input-checkbox" value="choice_0"/><label id="4bb1f55ed1164be2a32fbd938afd66fc_4_1-choice_0-label" for="input_4bb1f55ed1164be2a32fbd938afd66fc_4_1_choice_0" class="response-label field-label label-inline" aria-describedby="status_4bb1f55ed1164be2a32fbd938afd66fc_4_1"> (-11,3)
</label>
</div>
<div class="field">
<input type="checkbox" name="input_4bb1f55ed1164be2a32fbd938afd66fc_4_1[]" id="input_4bb1f55ed1164be2a32fbd938afd66fc_4_1_choice_1" class="field-input input-checkbox" value="choice_1"/><label id="4bb1f55ed1164be2a32fbd938afd66fc_4_1-choice_1-label" for="input_4bb1f55ed1164be2a32fbd938afd66fc_4_1_choice_1" class="response-label field-label label-inline" aria-describedby="status_4bb1f55ed1164be2a32fbd938afd66fc_4_1"> (3,7)
</label>
</div>
<div class="field">
<input type="checkbox" name="input_4bb1f55ed1164be2a32fbd938afd66fc_4_1[]" id="input_4bb1f55ed1164be2a32fbd938afd66fc_4_1_choice_2" class="field-input input-checkbox" value="choice_2"/><label id="4bb1f55ed1164be2a32fbd938afd66fc_4_1-choice_2-label" for="input_4bb1f55ed1164be2a32fbd938afd66fc_4_1_choice_2" class="response-label field-label label-inline" aria-describedby="status_4bb1f55ed1164be2a32fbd938afd66fc_4_1"> (5,4)
</label>
</div>
<div class="field">
<input type="checkbox" name="input_4bb1f55ed1164be2a32fbd938afd66fc_4_1[]" id="input_4bb1f55ed1164be2a32fbd938afd66fc_4_1_choice_3" class="field-input input-checkbox" value="choice_3"/><label id="4bb1f55ed1164be2a32fbd938afd66fc_4_1-choice_3-label" for="input_4bb1f55ed1164be2a32fbd938afd66fc_4_1_choice_3" class="response-label field-label label-inline" aria-describedby="status_4bb1f55ed1164be2a32fbd938afd66fc_4_1"> (2,1)
</label>
</div>
<span id="answer_4bb1f55ed1164be2a32fbd938afd66fc_4_1"/>
</fieldset>
<div class="indicator-container">
<span class="status unanswered" id="status_4bb1f55ed1164be2a32fbd938afd66fc_4_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
</div>
</div></div>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 4" role="group"><p> 4. Which of the following is true about Floyd's Invariant Principle?</p>
<div class="choicegroup capa_inputtype" id="inputtype_4bb1f55ed1164be2a32fbd938afd66fc_5_1">
<fieldset aria-describedby="status_4bb1f55ed1164be2a32fbd938afd66fc_5_1">
<div class="field">
<input type="checkbox" name="input_4bb1f55ed1164be2a32fbd938afd66fc_5_1[]" id="input_4bb1f55ed1164be2a32fbd938afd66fc_5_1_choice_0" class="field-input input-checkbox" value="choice_0"/><label id="4bb1f55ed1164be2a32fbd938afd66fc_5_1-choice_0-label" for="input_4bb1f55ed1164be2a32fbd938afd66fc_5_1_choice_0" class="response-label field-label label-inline" aria-describedby="status_4bb1f55ed1164be2a32fbd938afd66fc_5_1"> It is induction reforumlated for state machines.
</label>
</div>
<div class="field">
<input type="checkbox" name="input_4bb1f55ed1164be2a32fbd938afd66fc_5_1[]" id="input_4bb1f55ed1164be2a32fbd938afd66fc_5_1_choice_1" class="field-input input-checkbox" value="choice_1"/><label id="4bb1f55ed1164be2a32fbd938afd66fc_5_1-choice_1-label" for="input_4bb1f55ed1164be2a32fbd938afd66fc_5_1_choice_1" class="response-label field-label label-inline" aria-describedby="status_4bb1f55ed1164be2a32fbd938afd66fc_5_1"> For a preserved invariant <math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>P</mi>
<mo stretchy="false">(</mo>
<mtext>state</mtext>
<mo stretchy="false">)</mo>
</math>, if <math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>P</mi>
<mo stretchy="false">(</mo>
<mtext>start state</mtext>
<mo stretchy="false">)</mo>
</math>, then <math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>P</mi>
<mo stretchy="false">(</mo>
<mi>r</mi>
<mo stretchy="false">)</mo>
</math>, for all reachable states <math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>r</mi>
</math>.
</label>
</div>
<div class="field">
<input type="checkbox" name="input_4bb1f55ed1164be2a32fbd938afd66fc_5_1[]" id="input_4bb1f55ed1164be2a32fbd938afd66fc_5_1_choice_2" class="field-input input-checkbox" value="choice_2"/><label id="4bb1f55ed1164be2a32fbd938afd66fc_5_1-choice_2-label" for="input_4bb1f55ed1164be2a32fbd938afd66fc_5_1_choice_2" class="response-label field-label label-inline" aria-describedby="status_4bb1f55ed1164be2a32fbd938afd66fc_5_1"> Preserved invariants are the same as invariants.
</label>
</div>
<div class="field">
<input type="checkbox" name="input_4bb1f55ed1164be2a32fbd938afd66fc_5_1[]" id="input_4bb1f55ed1164be2a32fbd938afd66fc_5_1_choice_3" class="field-input input-checkbox" value="choice_3"/><label id="4bb1f55ed1164be2a32fbd938afd66fc_5_1-choice_3-label" for="input_4bb1f55ed1164be2a32fbd938afd66fc_5_1_choice_3" class="response-label field-label label-inline" aria-describedby="status_4bb1f55ed1164be2a32fbd938afd66fc_5_1"> Any preserved invariant of a state machine is a property of the states, including the final state, if any.
</label>
</div>
<span id="answer_4bb1f55ed1164be2a32fbd938afd66fc_5_1"/>
</fieldset>
<div class="indicator-container">
<span class="status unanswered" id="status_4bb1f55ed1164be2a32fbd938afd66fc_5_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
</div>
</div></div>
</div>
<div class="action">
<input type="hidden" name="problem_id" value="State Machine Invariants" />
<div class="submit-attempt-container">
<button type="button" class="submit btn-brand" data-submitting="Submitting" data-value="Submit" data-should-enable-submit-button="True" aria-describedby="submission_feedback_4bb1f55ed1164be2a32fbd938afd66fc" >
<span class="submit-label">Submit</span>
</button>
<div class="submission-feedback" id="submission_feedback_4bb1f55ed1164be2a32fbd938afd66fc">
<span class="sr">Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.</span>
</div>
</div>
<div class="problem-action-buttons-wrapper">
<span class="problem-action-button-wrapper">
<button type="button" class="reset problem-action-btn btn-default btn-small" data-value="Reset"><span class="icon fa fa-refresh" aria-hidden="true"></span><span aria-hidden="true">Reset</span><span class="sr">Reset your answer</span></button>
</span>
<span class="problem-action-button-wrapper">
<button type="button" class="show problem-action-btn btn-default btn-small" aria-describedby="4bb1f55ed1164be2a32fbd938afd66fc-problem-title"><span class="icon fa fa-info-circle" aria-hidden="true"></span><span class="show-label">Show Answer</span></button>
</span>
</div>
</div>
<div class="notification warning notification-gentle-alert
is-hidden"
tabindex="-1">
<span class="icon fa fa-exclamation-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="4bb1f55ed1164be2a32fbd938afd66fc-problem-title">
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification warning notification-save
is-hidden"
tabindex="-1">
<span class="icon fa fa-save" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="4bb1f55ed1164be2a32fbd938afd66fc-problem-title">None
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification general notification-show-answer
is-hidden"
tabindex="-1">
<span class="icon fa fa-info-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="4bb1f55ed1164be2a32fbd938afd66fc-problem-title">Answers are displayed within the problem
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
</div>
"
data-graded="False">
<p class="loading-spinner">
<i class="fa fa-spinner fa-pulse fa-2x fa-fw"></i>
<span class="sr">Loading…</span>
</p>
</div>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-course-id="course-v1:OCW+6.042J+2T2019" data-runtime-class="LmsRuntime" data-request-token="a478a16ae12211ef932116ffeba94eb7" data-block-type="vertical" data-graded="False" data-runtime-version="1" data-init="VerticalStudentView" data-has-score="False" data-usage-id="block-v1:OCW+6.042J+2T2019+type@vertical+block@87c5f872509040c28579a9596a91f704">
<h2 class="hd hd-2 unit-title">Lecture Video | Derived Variables</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:OCW+6.042J+2T2019+type@video+block@1c0af99970aa4e63b2165457c4f7d042">
<div class="xblock xblock-public_view xblock-public_view-video xmodule_display xmodule_VideoBlock" data-course-id="course-v1:OCW+6.042J+2T2019" data-runtime-class="LmsRuntime" data-request-token="a478a16ae12211ef932116ffeba94eb7" data-block-type="video" data-graded="False" data-runtime-version="1" data-init="XBlockToXModuleShim" data-has-score="False" data-usage-id="block-v1:OCW+6.042J+2T2019+type@video+block@1c0af99970aa4e63b2165457c4f7d042">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Video"}
</script>
<h3 class="hd hd-2">Derived Variables</h3>
<div
id="video_1c0af99970aa4e63b2165457c4f7d042"
class="video closed"
data-metadata='{"streams": "1.00:a7JUH-EtHtI", "autohideHtml5": false, "autoplay": false, "transcriptTranslationUrl": "/courses/course-v1:OCW+6.042J+2T2019/xblock/block-v1:OCW+6.042J+2T2019+type@video+block@1c0af99970aa4e63b2165457c4f7d042/handler/transcript/translation/__lang__", "transcriptLanguage": "en", "publishCompletionUrl": "/courses/course-v1:OCW+6.042J+2T2019/xblock/block-v1:OCW+6.042J+2T2019+type@video+block@1c0af99970aa4e63b2165457c4f7d042/handler/publish_completion", "transcriptAvailableTranslationsUrl": "/courses/course-v1:OCW+6.042J+2T2019/xblock/block-v1:OCW+6.042J+2T2019+type@video+block@1c0af99970aa4e63b2165457c4f7d042/handler/transcript/available_translations", "completionEnabled": false, "generalSpeed": 1.0, "ytTestTimeout": 1500, "ytMetadataEndpoint": "", "ytApiUrl": "https://www.youtube.com/iframe_api", "showCaptions": "true", "recordedYoutubeIsAvailable": true, "sources": ["https://ia800207.us.archive.org/32/items/MIT6.042JS15/MIT6_042JS15_derivedvariables_ipod.mp4"], "end": 0.0, "saveStateEnabled": false, "prioritizeHls": false, "savedVideoPosition": 0.0, "captionDataDir": null, "transcriptLanguages": {"en": "English"}, "start": 0.0, "saveStateUrl": "/courses/course-v1:OCW+6.042J+2T2019/xblock/block-v1:OCW+6.042J+2T2019+type@video+block@1c0af99970aa4e63b2165457c4f7d042/handler/xmodule_handler/save_user_state", "speed": null, "autoAdvance": false, "completionPercentage": 0.95, "duration": 0.0, "lmsRootURL": "https://openlearninglibrary.mit.edu", "poster": null}'
data-bumper-metadata='null'
data-autoadvance-enabled="False"
data-poster='null'
tabindex="-1"
>
<div class="focus_grabber first"></div>
<div class="tc-wrapper">
<div class="video-wrapper">
<span tabindex="0" class="spinner" aria-hidden="false" aria-label="Loading video player"></span>
<span tabindex="-1" class="btn-play fa fa-youtube-play fa-2x is-hidden" aria-hidden="true" aria-label="Play video"></span>
<div class="video-player-pre"></div>
<div class="video-player">
<div id="1c0af99970aa4e63b2165457c4f7d042"></div>
<h4 class="hd hd-4 video-error is-hidden">No playable video sources found.</h4>
<h4 class="hd hd-4 video-hls-error is-hidden">
Your browser does not support this video format. Try using a different browser.
</h4>
</div>
<div class="video-player-post"></div>
<div class="closed-captions"></div>
<div class="video-controls is-hidden">
<div>
<div class="vcr"><div class="vidtime">0:00 / 0:00</div></div>
<div class="secondary-controls"></div>
</div>
</div>
</div>
</div>
<div class="focus_grabber last"></div>
<h3 class="hd hd-4 downloads-heading sr" id="video-download-transcripts_1c0af99970aa4e63b2165457c4f7d042">Downloads and transcripts</h3>
<div class="wrapper-downloads" role="region" aria-labelledby="video-download-transcripts_1c0af99970aa4e63b2165457c4f7d042">
<div class="wrapper-download-video">
<h4 class="hd hd-5">Video</h4>
<a class="btn-link video-sources video-download-button" href="https://ia800207.us.archive.org/32/items/MIT6.042JS15/MIT6_042JS15_derivedvariables_ipod.mp4">
Download video file
</a>
</div>
<div class="wrapper-download-transcripts">
<h4 class="hd hd-5">Transcripts</h4>
<ul class="list-download-transcripts">
<li class="transcript-option">
<a class="btn btn-link" href="/courses/course-v1:OCW+6.042J+2T2019/xblock/block-v1:OCW+6.042J+2T2019+type@video+block@1c0af99970aa4e63b2165457c4f7d042/handler/transcript/download" data-value="srt">Download SubRip (.srt) file</a>
</li>
<li class="transcript-option">
<a class="btn btn-link" href="/courses/course-v1:OCW+6.042J+2T2019/xblock/block-v1:OCW+6.042J+2T2019+type@video+block@1c0af99970aa4e63b2165457c4f7d042/handler/transcript/download" data-value="txt">Download Text (.txt) file</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:OCW+6.042J+2T2019+type@html+block@7abad246597b473c98ad00735b3d3d35">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-course-id="course-v1:OCW+6.042J+2T2019" data-runtime-class="LmsRuntime" data-request-token="a478a16ae12211ef932116ffeba94eb7" data-block-type="html" data-graded="False" data-runtime-version="1" data-init="XBlockToXModuleShim" data-has-score="False" data-usage-id="block-v1:OCW+6.042J+2T2019+type@html+block@7abad246597b473c98ad00735b3d3d35">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<p>Download a copy of the slides for <a href="/assets/courseware/v1/517cf6b995a13b10c5ec9e177641f8b0/asset-v1:OCW+6.042J+2T2019+type@asset+block/MIT6_042JS16_DerivedVaria.pdf" target="[object Object]">Derived Variables (PDF)</a></p>
<p><a href="/assets/courseware/v1/ed11b1573a4510ea6837d93ebf986aff/asset-v1:OCW+6.042J+2T2019+type@asset+block/DerivedVar_1.9_Lectrans.pdf" target="[object Object]">Lecture video transcript (PDF)</a></p>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-course-id="course-v1:OCW+6.042J+2T2019" data-runtime-class="LmsRuntime" data-request-token="a478a16ae12211ef932116ffeba94eb7" data-block-type="vertical" data-graded="False" data-runtime-version="1" data-init="VerticalStudentView" data-has-score="False" data-usage-id="block-v1:OCW+6.042J+2T2019+type@vertical+block@62e96ff52064402093e30668b0ca49dd">
<h2 class="hd hd-2 unit-title">Exercise | Derived Variables and Termination</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:OCW+6.042J+2T2019+type@problem+block@ffd41ccb35594840a46effcbe22bbffd">
<div class="xblock xblock-public_view xblock-public_view-problem xmodule_display xmodule_ProblemBlock" data-course-id="course-v1:OCW+6.042J+2T2019" data-runtime-class="LmsRuntime" data-request-token="a478a16ae12211ef932116ffeba94eb7" data-block-type="problem" data-graded="False" data-runtime-version="1" data-init="XBlockToXModuleShim" data-has-score="True" data-usage-id="block-v1:OCW+6.042J+2T2019+type@problem+block@ffd41ccb35594840a46effcbe22bbffd">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Problem"}
</script>
<div id="problem_ffd41ccb35594840a46effcbe22bbffd" class="problems-wrapper" role="group"
aria-labelledby="ffd41ccb35594840a46effcbe22bbffd-problem-title"
data-problem-id="block-v1:OCW+6.042J+2T2019+type@problem+block@ffd41ccb35594840a46effcbe22bbffd" data-url="/courses/course-v1:OCW+6.042J+2T2019/xblock/block-v1:OCW+6.042J+2T2019+type@problem+block@ffd41ccb35594840a46effcbe22bbffd/handler/xmodule_handler"
data-problem-score="0"
data-problem-total-possible="4"
data-attempts-used="0"
data-content="
<h3 class="hd hd-3 problem-header" id="ffd41ccb35594840a46effcbe22bbffd-problem-title" aria-describedby="block-v1:OCW+6.042J+2T2019+type@problem+block@ffd41ccb35594840a46effcbe22bbffd-problem-progress" tabindex="-1">
Derived Variables and Termination
</h3>
<div class="problem-progress" id="block-v1:OCW+6.042J+2T2019+type@problem+block@ffd41ccb35594840a46effcbe22bbffd-problem-progress"></div>
<div class="problem">
<div>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 1" role="group"><p> 1. For state machines, a <em>derived variable</em> is a _____, of real variables, that assigns a "value" to each state. </p>
<div class="inputtype option-input ">
<select name="input_ffd41ccb35594840a46effcbe22bbffd_2_1" id="input_ffd41ccb35594840a46effcbe22bbffd_2_1" aria-describedby="status_ffd41ccb35594840a46effcbe22bbffd_2_1">
<option value="option_ffd41ccb35594840a46effcbe22bbffd_2_1_dummy_default">Select an option</option>
<option value="Derivative"> Derivative</option>
<option value="Sum"> Sum</option>
<option value="Function"> Function</option>
<option value="Rule"> Rule</option>
</select>
<div class="indicator-container">
<span class="status unanswered" id="status_ffd41ccb35594840a46effcbe22bbffd_2_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
</div>
<p class="answer" id="answer_ffd41ccb35594840a46effcbe22bbffd_2_1"/>
</div></div>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 2" role="group"><p> 2. Which of the following is a derived variable for the diagonal robot on the grid example?
</p>
<div class="inputtype option-input ">
<select name="input_ffd41ccb35594840a46effcbe22bbffd_3_1" id="input_ffd41ccb35594840a46effcbe22bbffd_3_1" aria-describedby="status_ffd41ccb35594840a46effcbe22bbffd_3_1">
<option value="option_ffd41ccb35594840a46effcbe22bbffd_3_1_dummy_default">Select an option</option>
<option value="x+y (mod 2)"> x+y (mod 2)</option>
<option value="x"> x</option>
<option value="y"> y</option>
<option value="There are no derived variables"> There are no derived variables</option>
</select>
<div class="indicator-container">
<span class="status unanswered" id="status_ffd41ccb35594840a46effcbe22bbffd_3_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
</div>
<p class="answer" id="answer_ffd41ccb35594840a46effcbe22bbffd_3_1"/>
</div></div>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 3" role="group"><p> 3. A derived variable is a <em>constant</em> iff it is both _____increasing and _____ decreasing.
</p>
<div class="inputtype option-input ">
<select name="input_ffd41ccb35594840a46effcbe22bbffd_4_1" id="input_ffd41ccb35594840a46effcbe22bbffd_4_1" aria-describedby="status_ffd41ccb35594840a46effcbe22bbffd_4_1">
<option value="option_ffd41ccb35594840a46effcbe22bbffd_4_1_dummy_default">Select an option</option>
<option value="strictly, strictly"> strictly, strictly</option>
<option value="strictly, weakly"> strictly, weakly</option>
<option value="weakly, weakly"> weakly, weakly</option>
<option value="weakly, strictly"> weakly, strictly</option>
</select>
<div class="indicator-container">
<span class="status unanswered" id="status_ffd41ccb35594840a46effcbe22bbffd_4_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
</div>
<p class="answer" id="answer_ffd41ccb35594840a46effcbe22bbffd_4_1"/>
</div></div>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 4" role="group"><div class="inputtype option-input ">
<label class="problem-group-label" for="input_ffd41ccb35594840a46effcbe22bbffd_5_1" id="label_ffd41ccb35594840a46effcbe22bbffd_5_1">4. Termination of a state machine is guaranteed if it has a derived variable on <math xmlns="http://www.w3.org/1998/Math/MathML">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">N</mi>
</mrow>
</math> that is _____ decreasing in any _____.</label>
<select name="input_ffd41ccb35594840a46effcbe22bbffd_5_1" id="input_ffd41ccb35594840a46effcbe22bbffd_5_1" aria-describedby="status_ffd41ccb35594840a46effcbe22bbffd_5_1">
<option value="option_ffd41ccb35594840a46effcbe22bbffd_5_1_dummy_default">Select an option</option>
<option value="weakly, well ordered set"> weakly, well ordered set</option>
<option value="strictly, well ordered set"> strictly, well ordered set</option>
<option value="weakly, finite set"> weakly, finite set</option>
<option value="strictly, finite set"> strictly, finite set</option>
</select>
<div class="indicator-container">
<span class="status unanswered" id="status_ffd41ccb35594840a46effcbe22bbffd_5_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
</div>
<p class="answer" id="answer_ffd41ccb35594840a46effcbe22bbffd_5_1"/>
</div></div>
</div>
<div class="action">
<input type="hidden" name="problem_id" value="Derived Variables and Termination" />
<div class="submit-attempt-container">
<button type="button" class="submit btn-brand" data-submitting="Submitting" data-value="Submit" data-should-enable-submit-button="True" aria-describedby="submission_feedback_ffd41ccb35594840a46effcbe22bbffd" >
<span class="submit-label">Submit</span>
</button>
<div class="submission-feedback" id="submission_feedback_ffd41ccb35594840a46effcbe22bbffd">
<span class="sr">Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.</span>
</div>
</div>
<div class="problem-action-buttons-wrapper">
<span class="problem-action-button-wrapper">
<button type="button" class="reset problem-action-btn btn-default btn-small" data-value="Reset"><span class="icon fa fa-refresh" aria-hidden="true"></span><span aria-hidden="true">Reset</span><span class="sr">Reset your answer</span></button>
</span>
<span class="problem-action-button-wrapper">
<button type="button" class="show problem-action-btn btn-default btn-small" aria-describedby="ffd41ccb35594840a46effcbe22bbffd-problem-title"><span class="icon fa fa-info-circle" aria-hidden="true"></span><span class="show-label">Show Answer</span></button>
</span>
</div>
</div>
<div class="notification warning notification-gentle-alert
is-hidden"
tabindex="-1">
<span class="icon fa fa-exclamation-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="ffd41ccb35594840a46effcbe22bbffd-problem-title">
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification warning notification-save
is-hidden"
tabindex="-1">
<span class="icon fa fa-save" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="ffd41ccb35594840a46effcbe22bbffd-problem-title">None
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification general notification-show-answer
is-hidden"
tabindex="-1">
<span class="icon fa fa-info-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="ffd41ccb35594840a46effcbe22bbffd-problem-title">Answers are displayed within the problem
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
</div>
"
data-graded="False">
<p class="loading-spinner">
<i class="fa fa-spinner fa-pulse fa-2x fa-fw"></i>
<span class="sr">Loading…</span>
</p>
</div>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-course-id="course-v1:OCW+6.042J+2T2019" data-runtime-class="LmsRuntime" data-request-token="a478a16ae12211ef932116ffeba94eb7" data-block-type="vertical" data-graded="False" data-runtime-version="1" data-init="VerticalStudentView" data-has-score="False" data-usage-id="block-v1:OCW+6.042J+2T2019+type@vertical+block@1b0e288d62694043ba5c9eed5b89ac96">
<h2 class="hd hd-2 unit-title">Exercise | Integer Multiplication</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:OCW+6.042J+2T2019+type@html+block@37b0abb39c774754a905d3967af667bc">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-course-id="course-v1:OCW+6.042J+2T2019" data-runtime-class="LmsRuntime" data-request-token="a478a16ae12211ef932116ffeba94eb7" data-block-type="html" data-graded="False" data-runtime-version="1" data-init="XBlockToXModuleShim" data-has-score="False" data-usage-id="block-v1:OCW+6.042J+2T2019+type@html+block@37b0abb39c774754a905d3967af667bc">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<p>Suppose that the following procedure is used to multiply two non-negative integers a and b.</p>
<ul>
<li><math xmlns="http://www.w3.org/1998/Math/MathML"> <mi>x</mi> <mo>::=</mo> <mi>a</mi> </math></li>
<li><math xmlns="http://www.w3.org/1998/Math/MathML"> <mi>y</mi> <mo>::=</mo> <mi>b</mi> </math></li>
<li><math xmlns="http://www.w3.org/1998/Math/MathML"> <mi>p</mi> <mo>::=</mo> <mn>0</mn> </math></li>
</ul>
<p>Repeat the following commands:</p>
<ul>
<li>if <math xmlns="http://www.w3.org/1998/Math/MathML"> <mi>x</mi> <mo>=</mo> <mn>0</mn> </math>, then output <math xmlns="http://www.w3.org/1998/Math/MathML"> <mi>p</mi> </math> and terminate; else</li>
<li>if <math xmlns="http://www.w3.org/1998/Math/MathML"> <mi>x</mi> </math> is even, then set <math xmlns="http://www.w3.org/1998/Math/MathML"> <mi>x</mi> <mo stretchy="false">←<!-- ← --></mo> <mi>x</mi> <mrow class="MJX-TeXAtom-ORD"> <mo>/</mo> </mrow> <mn>2</mn> </math> and <math xmlns="http://www.w3.org/1998/Math/MathML"> <mi>y</mi> <mo stretchy="false">←<!-- ← --></mo> <mn>2</mn> <mi>y</mi></math> ; else</li>
<li>if <math xmlns="http://www.w3.org/1998/Math/MathML"> <mi>x</mi> </math> is odd, then set <math xmlns="http://www.w3.org/1998/Math/MathML"> <mi>x</mi> <mo stretchy="false">←<!-- ← --></mo> <mi>x</mi> <mo>−<!-- − --></mo> <mn>1</mn> </math> and <math xmlns="http://www.w3.org/1998/Math/MathML"> <mi>p</mi> <mo stretchy="false">←<!-- ← --></mo> <mi>p</mi> <mo>+</mo> <mi>y</mi> </math></li>
</ul>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:OCW+6.042J+2T2019+type@problem+block@014290af7204483bb1bc845417a0157b">
<div class="xblock xblock-public_view xblock-public_view-problem xmodule_display xmodule_ProblemBlock" data-course-id="course-v1:OCW+6.042J+2T2019" data-runtime-class="LmsRuntime" data-request-token="a478a16ae12211ef932116ffeba94eb7" data-block-type="problem" data-graded="False" data-runtime-version="1" data-init="XBlockToXModuleShim" data-has-score="True" data-usage-id="block-v1:OCW+6.042J+2T2019+type@problem+block@014290af7204483bb1bc845417a0157b">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Problem"}
</script>
<div id="problem_014290af7204483bb1bc845417a0157b" class="problems-wrapper" role="group"
aria-labelledby="014290af7204483bb1bc845417a0157b-problem-title"
data-problem-id="block-v1:OCW+6.042J+2T2019+type@problem+block@014290af7204483bb1bc845417a0157b" data-url="/courses/course-v1:OCW+6.042J+2T2019/xblock/block-v1:OCW+6.042J+2T2019+type@problem+block@014290af7204483bb1bc845417a0157b/handler/xmodule_handler"
data-problem-score="0"
data-problem-total-possible="2"
data-attempts-used="0"
data-content="
<h3 class="hd hd-3 problem-header" id="014290af7204483bb1bc845417a0157b-problem-title" aria-describedby="block-v1:OCW+6.042J+2T2019+type@problem+block@014290af7204483bb1bc845417a0157b-problem-progress" tabindex="-1">
Questions
</h3>
<div class="problem-progress" id="block-v1:OCW+6.042J+2T2019+type@problem+block@014290af7204483bb1bc845417a0157b-problem-progress"></div>
<div class="problem">
<div>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 1" role="group"><p>1. Which of the following predicates are <em> preserved invariants</em> for this algorithm?</p>
<div class="choicegroup capa_inputtype" id="inputtype_014290af7204483bb1bc845417a0157b_2_1">
<fieldset aria-describedby="status_014290af7204483bb1bc845417a0157b_2_1">
<legend id="014290af7204483bb1bc845417a0157b_2_1-legend" class="response-fieldset-legend field-group-hd">Suppose that the following procedure is used to multiply two non-negative integers a and b.</legend>
<div class="field">
<input type="radio" name="input_014290af7204483bb1bc845417a0157b_2_1" id="input_014290af7204483bb1bc845417a0157b_2_1_choice_0" class="field-input input-radio" value="choice_0"/><label id="014290af7204483bb1bc845417a0157b_2_1-choice_0-label" for="input_014290af7204483bb1bc845417a0157b_2_1_choice_0" class="response-label field-label label-inline" aria-describedby="status_014290af7204483bb1bc845417a0157b_2_1"> <math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>x</mi>
<mi>y</mi>
<mo>=</mo>
<mi>p</mi>
</math>
</label>
</div>
<div class="field">
<input type="radio" name="input_014290af7204483bb1bc845417a0157b_2_1" id="input_014290af7204483bb1bc845417a0157b_2_1_choice_1" class="field-input input-radio" value="choice_1"/><label id="014290af7204483bb1bc845417a0157b_2_1-choice_1-label" for="input_014290af7204483bb1bc845417a0157b_2_1_choice_1" class="response-label field-label label-inline" aria-describedby="status_014290af7204483bb1bc845417a0157b_2_1"> <math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>x</mi>
<mi>y</mi>
<mo>=</mo>
<mi>a</mi>
<mi>b</mi>
</math>
</label>
</div>
<div class="field">
<input type="radio" name="input_014290af7204483bb1bc845417a0157b_2_1" id="input_014290af7204483bb1bc845417a0157b_2_1_choice_2" class="field-input input-radio" value="choice_2"/><label id="014290af7204483bb1bc845417a0157b_2_1-choice_2-label" for="input_014290af7204483bb1bc845417a0157b_2_1_choice_2" class="response-label field-label label-inline" aria-describedby="status_014290af7204483bb1bc845417a0157b_2_1"> <math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>x</mi>
<mi>y</mi>
<mo>+</mo>
<mi>p</mi>
<mo>=</mo>
<mi>a</mi>
<mi>b</mi>
</math>
</label>
</div>
<div class="field">
<input type="radio" name="input_014290af7204483bb1bc845417a0157b_2_1" id="input_014290af7204483bb1bc845417a0157b_2_1_choice_3" class="field-input input-radio" value="choice_3"/><label id="014290af7204483bb1bc845417a0157b_2_1-choice_3-label" for="input_014290af7204483bb1bc845417a0157b_2_1_choice_3" class="response-label field-label label-inline" aria-describedby="status_014290af7204483bb1bc845417a0157b_2_1"> <math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>x</mi>
<mi>y</mi>
<mi>p</mi>
<mo>=</mo>
<mi>a</mi>
<mi>b</mi>
</math>
</label>
</div>
<span id="answer_014290af7204483bb1bc845417a0157b_2_1"/>
</fieldset>
<div class="indicator-container">
<span class="status unanswered" id="status_014290af7204483bb1bc845417a0157b_2_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
</div>
</div></div>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 2" role="group"><p> 2. Which of the following derived quantities get smaller at every transition?</p>
<div class="choicegroup capa_inputtype" id="inputtype_014290af7204483bb1bc845417a0157b_3_1">
<fieldset aria-describedby="status_014290af7204483bb1bc845417a0157b_3_1">
<div class="field">
<input type="radio" name="input_014290af7204483bb1bc845417a0157b_3_1" id="input_014290af7204483bb1bc845417a0157b_3_1_choice_0" class="field-input input-radio" value="choice_0"/><label id="014290af7204483bb1bc845417a0157b_3_1-choice_0-label" for="input_014290af7204483bb1bc845417a0157b_3_1_choice_0" class="response-label field-label label-inline" aria-describedby="status_014290af7204483bb1bc845417a0157b_3_1"> <math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>x</mi>
</math>
</label>
</div>
<div class="field">
<input type="radio" name="input_014290af7204483bb1bc845417a0157b_3_1" id="input_014290af7204483bb1bc845417a0157b_3_1_choice_1" class="field-input input-radio" value="choice_1"/><label id="014290af7204483bb1bc845417a0157b_3_1-choice_1-label" for="input_014290af7204483bb1bc845417a0157b_3_1_choice_1" class="response-label field-label label-inline" aria-describedby="status_014290af7204483bb1bc845417a0157b_3_1"> <math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>x</mi>
<mi>y</mi>
</math>
</label>
</div>
<div class="field">
<input type="radio" name="input_014290af7204483bb1bc845417a0157b_3_1" id="input_014290af7204483bb1bc845417a0157b_3_1_choice_2" class="field-input input-radio" value="choice_2"/><label id="014290af7204483bb1bc845417a0157b_3_1-choice_2-label" for="input_014290af7204483bb1bc845417a0157b_3_1_choice_2" class="response-label field-label label-inline" aria-describedby="status_014290af7204483bb1bc845417a0157b_3_1"> <math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>p</mi>
<mo>&#8722;<!-- &#8722; --></mo>
<mi>y</mi>
</math>
</label>
</div>
<div class="field">
<input type="radio" name="input_014290af7204483bb1bc845417a0157b_3_1" id="input_014290af7204483bb1bc845417a0157b_3_1_choice_3" class="field-input input-radio" value="choice_3"/><label id="014290af7204483bb1bc845417a0157b_3_1-choice_3-label" for="input_014290af7204483bb1bc845417a0157b_3_1_choice_3" class="response-label field-label label-inline" aria-describedby="status_014290af7204483bb1bc845417a0157b_3_1"> <math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>x</mi>
<mo>+</mo>
<mi>p</mi>
</math>
</label>
</div>
<span id="answer_014290af7204483bb1bc845417a0157b_3_1"/>
</fieldset>
<div class="indicator-container">
<span class="status unanswered" id="status_014290af7204483bb1bc845417a0157b_3_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
</div>
</div></div>
<div class="solution-span">
<span id="solution_014290af7204483bb1bc845417a0157b_solution_1"/>
</div><div class="solution-span">
<span id="solution_014290af7204483bb1bc845417a0157b_solution_2"/>
</div></div>
<div class="action">
<input type="hidden" name="problem_id" value="Questions" />
<div class="submit-attempt-container">
<button type="button" class="submit btn-brand" data-submitting="Submitting" data-value="Submit" data-should-enable-submit-button="True" aria-describedby="submission_feedback_014290af7204483bb1bc845417a0157b" >
<span class="submit-label">Submit</span>
</button>
<div class="submission-feedback" id="submission_feedback_014290af7204483bb1bc845417a0157b">
<span class="sr">Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.</span>
</div>
</div>
<div class="problem-action-buttons-wrapper">
<span class="problem-action-button-wrapper">
<button type="button" class="reset problem-action-btn btn-default btn-small" data-value="Reset"><span class="icon fa fa-refresh" aria-hidden="true"></span><span aria-hidden="true">Reset</span><span class="sr">Reset your answer</span></button>
</span>
<span class="problem-action-button-wrapper">
<button type="button" class="show problem-action-btn btn-default btn-small" aria-describedby="014290af7204483bb1bc845417a0157b-problem-title"><span class="icon fa fa-info-circle" aria-hidden="true"></span><span class="show-label">Show Answer</span></button>
</span>
</div>
</div>
<div class="notification warning notification-gentle-alert
is-hidden"
tabindex="-1">
<span class="icon fa fa-exclamation-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="014290af7204483bb1bc845417a0157b-problem-title">
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification warning notification-save
is-hidden"
tabindex="-1">
<span class="icon fa fa-save" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="014290af7204483bb1bc845417a0157b-problem-title">None
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification general notification-show-answer
is-hidden"
tabindex="-1">
<span class="icon fa fa-info-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="014290af7204483bb1bc845417a0157b-problem-title">Answers are displayed within the problem
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
</div>
"
data-graded="False">
<p class="loading-spinner">
<i class="fa fa-spinner fa-pulse fa-2x fa-fw"></i>
<span class="sr">Loading…</span>
</p>
</div>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-course-id="course-v1:OCW+6.042J+2T2019" data-runtime-class="LmsRuntime" data-request-token="a478a16ae12211ef932116ffeba94eb7" data-block-type="vertical" data-graded="False" data-runtime-version="1" data-init="VerticalStudentView" data-has-score="False" data-usage-id="block-v1:OCW+6.042J+2T2019+type@vertical+block@68a8bcb4901641ed92f405636b632549">
<h2 class="hd hd-2 unit-title">Exercise | Chocolate Bars</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:OCW+6.042J+2T2019+type@problem+block@199869ed6031476fb187110e93b92f54">
<div class="xblock xblock-public_view xblock-public_view-problem xmodule_display xmodule_ProblemBlock" data-course-id="course-v1:OCW+6.042J+2T2019" data-runtime-class="LmsRuntime" data-request-token="a478a16ae12211ef932116ffeba94eb7" data-block-type="problem" data-graded="False" data-runtime-version="1" data-init="XBlockToXModuleShim" data-has-score="True" data-usage-id="block-v1:OCW+6.042J+2T2019+type@problem+block@199869ed6031476fb187110e93b92f54">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Problem"}
</script>
<div id="problem_199869ed6031476fb187110e93b92f54" class="problems-wrapper" role="group"
aria-labelledby="199869ed6031476fb187110e93b92f54-problem-title"
data-problem-id="block-v1:OCW+6.042J+2T2019+type@problem+block@199869ed6031476fb187110e93b92f54" data-url="/courses/course-v1:OCW+6.042J+2T2019/xblock/block-v1:OCW+6.042J+2T2019+type@problem+block@199869ed6031476fb187110e93b92f54/handler/xmodule_handler"
data-problem-score="0"
data-problem-total-possible="4"
data-attempts-used="0"
data-content="
<h3 class="hd hd-3 problem-header" id="199869ed6031476fb187110e93b92f54-problem-title" aria-describedby="block-v1:OCW+6.042J+2T2019+type@problem+block@199869ed6031476fb187110e93b92f54-problem-progress" tabindex="-1">
Chocolate Bars
</h3>
<div class="problem-progress" id="block-v1:OCW+6.042J+2T2019+type@problem+block@199869ed6031476fb187110e93b92f54-problem-progress"></div>
<div class="problem">
<div>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 1" role="group"><div class="choicegroup capa_inputtype" id="inputtype_199869ed6031476fb187110e93b92f54_2_1">
<fieldset aria-describedby="status_199869ed6031476fb187110e93b92f54_2_1">
<legend id="199869ed6031476fb187110e93b92f54_2_1-legend" class="response-fieldset-legend field-group-hd">We are given a chocolate bar with <math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>m</mi>
<mo>&#215;<!-- &#215; --></mo>
<mi>n</mi>
</math> squares of chocolate, and our task is to divide it into <math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>m</mi>
<mi>n</mi>
</math> individual squares. We are only allowed to split a chocolate bar using a vertical or a horizontal cut.
<br/>
<br/>
For example, suppose that the chocolate bar is <math xmlns="http://www.w3.org/1998/Math/MathML">
<mn>3</mn>
<mo>&#215;<!-- &#215; --></mo>
<mn>2</mn>
</math>. A horizontal cut between the first and second rows of squares splits it into two bars, a <math xmlns="http://www.w3.org/1998/Math/MathML">
<mn>1</mn>
<mo>&#215;<!-- &#215; --></mo>
<mn>2</mn>
</math> bar and a <math xmlns="http://www.w3.org/1998/Math/MathML">
<mn>2</mn>
<mo>&#215;<!-- &#215; --></mo>
<mn>2</mn>
</math> bar. One cut of the <math xmlns="http://www.w3.org/1998/Math/MathML">
<mn>1</mn>
<mo>&#215;<!-- &#215; --></mo>
<mn>2</mn>
</math> splits it into individual squares, and three more cuts splits the <math xmlns="http://www.w3.org/1998/Math/MathML">
<mn>2</mn>
<mo>&#215;<!-- &#215; --></mo>
<mn>2</mn>
</math> bar into squares. So a total of 5 cuts splits the whole <math xmlns="http://www.w3.org/1998/Math/MathML">
<mn>3</mn>
<mo>&#215;<!-- &#215; --></mo>
<mn>2</mn>
</math> bar into squares.
<br/>
<br/>
At each step of the division process, let <math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>s</mi>
</math> be the number of splits already performed, and <math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>p</mi>
</math> the number of pieces of chocolate obtained.
<br/>
<br/>
1. Which of the following predicates are <em>preserved invariants</em> for this process ?</legend>
<div class="field">
<input type="checkbox" name="input_199869ed6031476fb187110e93b92f54_2_1[]" id="input_199869ed6031476fb187110e93b92f54_2_1_choice_0" class="field-input input-checkbox" value="choice_0"/><label id="199869ed6031476fb187110e93b92f54_2_1-choice_0-label" for="input_199869ed6031476fb187110e93b92f54_2_1_choice_0" class="response-label field-label label-inline" aria-describedby="status_199869ed6031476fb187110e93b92f54_2_1"> <math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>s</mi>
<mo>=</mo>
<mi>p</mi>
<mo>&#8722;<!-- &#8722; --></mo>
<mn>1</mn>
</math>
</label>
</div>
<div class="field">
<input type="checkbox" name="input_199869ed6031476fb187110e93b92f54_2_1[]" id="input_199869ed6031476fb187110e93b92f54_2_1_choice_1" class="field-input input-checkbox" value="choice_1"/><label id="199869ed6031476fb187110e93b92f54_2_1-choice_1-label" for="input_199869ed6031476fb187110e93b92f54_2_1_choice_1" class="response-label field-label label-inline" aria-describedby="status_199869ed6031476fb187110e93b92f54_2_1"> <math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>s</mi>
<mo>&#8800;<!-- &#8800; --></mo>
<mi>p</mi>
</math>
</label>
</div>
<div class="field">
<input type="checkbox" name="input_199869ed6031476fb187110e93b92f54_2_1[]" id="input_199869ed6031476fb187110e93b92f54_2_1_choice_2" class="field-input input-checkbox" value="choice_2"/><label id="199869ed6031476fb187110e93b92f54_2_1-choice_2-label" for="input_199869ed6031476fb187110e93b92f54_2_1_choice_2" class="response-label field-label label-inline" aria-describedby="status_199869ed6031476fb187110e93b92f54_2_1"> <math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>s</mi>
<mo>=</mo>
<mi>m</mi>
<mi>n</mi>
<mo>&#8722;<!-- &#8722; --></mo>
<mi>p</mi>
</math>
</label>
</div>
<span id="answer_199869ed6031476fb187110e93b92f54_2_1"/>
</fieldset>
<div class="indicator-container">
<span class="status unanswered" id="status_199869ed6031476fb187110e93b92f54_2_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
</div>
</div></div>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 2" role="group"><p>2. Which of the following quantities get smaller at each transition?</p>
<div class="choicegroup capa_inputtype" id="inputtype_199869ed6031476fb187110e93b92f54_3_1">
<fieldset aria-describedby="status_199869ed6031476fb187110e93b92f54_3_1">
<div class="field">
<input type="checkbox" name="input_199869ed6031476fb187110e93b92f54_3_1[]" id="input_199869ed6031476fb187110e93b92f54_3_1_choice_0" class="field-input input-checkbox" value="choice_0"/><label id="199869ed6031476fb187110e93b92f54_3_1-choice_0-label" for="input_199869ed6031476fb187110e93b92f54_3_1_choice_0" class="response-label field-label label-inline" aria-describedby="status_199869ed6031476fb187110e93b92f54_3_1"> <math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>m</mi>
<mi>n</mi>
<mo>&#8722;<!-- &#8722; --></mo>
<mi>p</mi>
</math>
</label>
</div>
<div class="field">
<input type="checkbox" name="input_199869ed6031476fb187110e93b92f54_3_1[]" id="input_199869ed6031476fb187110e93b92f54_3_1_choice_1" class="field-input input-checkbox" value="choice_1"/><label id="199869ed6031476fb187110e93b92f54_3_1-choice_1-label" for="input_199869ed6031476fb187110e93b92f54_3_1_choice_1" class="response-label field-label label-inline" aria-describedby="status_199869ed6031476fb187110e93b92f54_3_1"> <math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>s</mi>
</math>
</label>
</div>
<div class="field">
<input type="checkbox" name="input_199869ed6031476fb187110e93b92f54_3_1[]" id="input_199869ed6031476fb187110e93b92f54_3_1_choice_2" class="field-input input-checkbox" value="choice_2"/><label id="199869ed6031476fb187110e93b92f54_3_1-choice_2-label" for="input_199869ed6031476fb187110e93b92f54_3_1_choice_2" class="response-label field-label label-inline" aria-describedby="status_199869ed6031476fb187110e93b92f54_3_1"> <math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>p</mi>
<mo>&#8722;<!-- &#8722; --></mo>
<mi>s</mi>
</math>
</label>
</div>
<span id="answer_199869ed6031476fb187110e93b92f54_3_1"/>
</fieldset>
<div class="indicator-container">
<span class="status unanswered" id="status_199869ed6031476fb187110e93b92f54_3_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
</div>
</div></div>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 3" role="group"><p>3. What is the number of pieces of chocolate at the end of the division process?</p>
<div class="choicegroup capa_inputtype" id="inputtype_199869ed6031476fb187110e93b92f54_4_1">
<fieldset aria-describedby="status_199869ed6031476fb187110e93b92f54_4_1">
<div class="field">
<input type="checkbox" name="input_199869ed6031476fb187110e93b92f54_4_1[]" id="input_199869ed6031476fb187110e93b92f54_4_1_choice_0" class="field-input input-checkbox" value="choice_0"/><label id="199869ed6031476fb187110e93b92f54_4_1-choice_0-label" for="input_199869ed6031476fb187110e93b92f54_4_1_choice_0" class="response-label field-label label-inline" aria-describedby="status_199869ed6031476fb187110e93b92f54_4_1"> <math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>p</mi>
<mo>=</mo>
<mi>m</mi>
<mi>n</mi>
<mo>&#8722;<!-- &#8722; --></mo>
<mn>1</mn>
</math>
</label>
</div>
<div class="field">
<input type="checkbox" name="input_199869ed6031476fb187110e93b92f54_4_1[]" id="input_199869ed6031476fb187110e93b92f54_4_1_choice_1" class="field-input input-checkbox" value="choice_1"/><label id="199869ed6031476fb187110e93b92f54_4_1-choice_1-label" for="input_199869ed6031476fb187110e93b92f54_4_1_choice_1" class="response-label field-label label-inline" aria-describedby="status_199869ed6031476fb187110e93b92f54_4_1"> <math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>p</mi>
<mo>=</mo>
<mi>s</mi>
<mo>&#8722;<!-- &#8722; --></mo>
<mn>1</mn>
</math>
</label>
</div>
<div class="field">
<input type="checkbox" name="input_199869ed6031476fb187110e93b92f54_4_1[]" id="input_199869ed6031476fb187110e93b92f54_4_1_choice_2" class="field-input input-checkbox" value="choice_2"/><label id="199869ed6031476fb187110e93b92f54_4_1-choice_2-label" for="input_199869ed6031476fb187110e93b92f54_4_1_choice_2" class="response-label field-label label-inline" aria-describedby="status_199869ed6031476fb187110e93b92f54_4_1"> <math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>p</mi>
<mo>=</mo>
<mi>m</mi>
<mi>n</mi>
</math>
</label>
</div>
<span id="answer_199869ed6031476fb187110e93b92f54_4_1"/>
</fieldset>
<div class="indicator-container">
<span class="status unanswered" id="status_199869ed6031476fb187110e93b92f54_4_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
</div>
</div></div>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 4" role="group"><p>4. What is the number of splits performed to reach the end of the division process?</p>
<div class="choicegroup capa_inputtype" id="inputtype_199869ed6031476fb187110e93b92f54_5_1">
<fieldset aria-describedby="status_199869ed6031476fb187110e93b92f54_5_1">
<div class="field">
<input type="checkbox" name="input_199869ed6031476fb187110e93b92f54_5_1[]" id="input_199869ed6031476fb187110e93b92f54_5_1_choice_0" class="field-input input-checkbox" value="choice_0"/><label id="199869ed6031476fb187110e93b92f54_5_1-choice_0-label" for="input_199869ed6031476fb187110e93b92f54_5_1_choice_0" class="response-label field-label label-inline" aria-describedby="status_199869ed6031476fb187110e93b92f54_5_1"> <math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>s</mi>
<mo>=</mo>
<mi>m</mi>
<mi>n</mi>
<mo>&#8722;<!-- &#8722; --></mo>
<mn>1</mn>
</math>
</label>
</div>
<div class="field">
<input type="checkbox" name="input_199869ed6031476fb187110e93b92f54_5_1[]" id="input_199869ed6031476fb187110e93b92f54_5_1_choice_1" class="field-input input-checkbox" value="choice_1"/><label id="199869ed6031476fb187110e93b92f54_5_1-choice_1-label" for="input_199869ed6031476fb187110e93b92f54_5_1_choice_1" class="response-label field-label label-inline" aria-describedby="status_199869ed6031476fb187110e93b92f54_5_1"> <math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>s</mi>
<mo>=</mo>
<mi>m</mi>
<mi>n</mi>
</math>
</label>
</div>
<div class="field">
<input type="checkbox" name="input_199869ed6031476fb187110e93b92f54_5_1[]" id="input_199869ed6031476fb187110e93b92f54_5_1_choice_2" class="field-input input-checkbox" value="choice_2"/><label id="199869ed6031476fb187110e93b92f54_5_1-choice_2-label" for="input_199869ed6031476fb187110e93b92f54_5_1_choice_2" class="response-label field-label label-inline" aria-describedby="status_199869ed6031476fb187110e93b92f54_5_1"> <math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>s</mi>
<mo>=</mo>
<mi>m</mi>
<mi>n</mi>
<mo>+</mo>
<mn>1</mn>
</math>
</label>
</div>
<span id="answer_199869ed6031476fb187110e93b92f54_5_1"/>
</fieldset>
<div class="indicator-container">
<span class="status unanswered" id="status_199869ed6031476fb187110e93b92f54_5_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
</div>
</div></div>
<div class="solution-span">
<span id="solution_199869ed6031476fb187110e93b92f54_solution_1"/>
</div><div class="solution-span">
<span id="solution_199869ed6031476fb187110e93b92f54_solution_2"/>
</div><div class="solution-span">
<span id="solution_199869ed6031476fb187110e93b92f54_solution_3"/>
</div></div>
<div class="action">
<input type="hidden" name="problem_id" value="Chocolate Bars" />
<div class="submit-attempt-container">
<button type="button" class="submit btn-brand" data-submitting="Submitting" data-value="Submit" data-should-enable-submit-button="True" aria-describedby="submission_feedback_199869ed6031476fb187110e93b92f54" >
<span class="submit-label">Submit</span>
</button>
<div class="submission-feedback" id="submission_feedback_199869ed6031476fb187110e93b92f54">
<span class="sr">Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.</span>
</div>
</div>
<div class="problem-action-buttons-wrapper">
<span class="problem-action-button-wrapper">
<button type="button" class="reset problem-action-btn btn-default btn-small" data-value="Reset"><span class="icon fa fa-refresh" aria-hidden="true"></span><span aria-hidden="true">Reset</span><span class="sr">Reset your answer</span></button>
</span>
<span class="problem-action-button-wrapper">
<button type="button" class="show problem-action-btn btn-default btn-small" aria-describedby="199869ed6031476fb187110e93b92f54-problem-title"><span class="icon fa fa-info-circle" aria-hidden="true"></span><span class="show-label">Show Answer</span></button>
</span>
</div>
</div>
<div class="notification warning notification-gentle-alert
is-hidden"
tabindex="-1">
<span class="icon fa fa-exclamation-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="199869ed6031476fb187110e93b92f54-problem-title">
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification warning notification-save
is-hidden"
tabindex="-1">
<span class="icon fa fa-save" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="199869ed6031476fb187110e93b92f54-problem-title">None
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification general notification-show-answer
is-hidden"
tabindex="-1">
<span class="icon fa fa-info-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="199869ed6031476fb187110e93b92f54-problem-title">Answers are displayed within the problem
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
</div>
"
data-graded="False">
<p class="loading-spinner">
<i class="fa fa-spinner fa-pulse fa-2x fa-fw"></i>
<span class="sr">Loading…</span>
</p>
</div>
</div>
</div>
</div>
</div>