{"id":44,"date":"2025-12-18T13:13:01","date_gmt":"2025-12-18T13:13:01","guid":{"rendered":"https:\/\/qc.thelazydreamer.com\/?p=44"},"modified":"2025-12-18T13:13:02","modified_gmt":"2025-12-18T13:13:02","slug":"chapter-3-how-to-think-in-qubo","status":"publish","type":"post","link":"https:\/\/qc.thelazydreamer.com\/?p=44","title":{"rendered":"Chapter 3: How to Think in\u00a0QUBO"},"content":{"rendered":"\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><em>(From Daily Life to Math, Step by Step)<\/em><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>QUBO is not about math first.<br>QUBO is about <strong>thinking clearly<\/strong>.<\/p>\n<\/blockquote>\n\n\n\n<p><strong>Goal of this chapter<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Learn a repeatable method to convert real problems into QUBO<\/li>\n\n\n\n<li>Understand how to think in variables, objectives, and constraints<\/li>\n\n\n\n<li>Practice with everyday, non-technical examples<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">1. The Universal QUBO Thinking&nbsp;Process<\/h3>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1600\" height=\"891\" src=\"https:\/\/qc.thelazydreamer.com\/wp-content\/uploads\/2025\/12\/1rlQTKewMPtheOuuJWR52hw.png\" alt=\"\" class=\"wp-image-46\" srcset=\"https:\/\/qc.thelazydreamer.com\/wp-content\/uploads\/2025\/12\/1rlQTKewMPtheOuuJWR52hw.png 1600w, https:\/\/qc.thelazydreamer.com\/wp-content\/uploads\/2025\/12\/1rlQTKewMPtheOuuJWR52hw-300x167.png 300w, https:\/\/qc.thelazydreamer.com\/wp-content\/uploads\/2025\/12\/1rlQTKewMPtheOuuJWR52hw-1024x570.png 1024w, https:\/\/qc.thelazydreamer.com\/wp-content\/uploads\/2025\/12\/1rlQTKewMPtheOuuJWR52hw-768x428.png 768w, https:\/\/qc.thelazydreamer.com\/wp-content\/uploads\/2025\/12\/1rlQTKewMPtheOuuJWR52hw-1536x855.png 1536w, https:\/\/qc.thelazydreamer.com\/wp-content\/uploads\/2025\/12\/1rlQTKewMPtheOuuJWR52hw-1140x635.png 1140w\" sizes=\"auto, (max-width: 1600px) 100vw, 1600px\" \/><\/figure>\n\n\n\n<p>No matter how complex a problem looks, QUBO modeling always follows the same steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>List choices<\/strong> (Yes \/ No decisions)<\/li>\n\n\n\n<li><strong>Create binary variables<\/strong> for each choice<\/li>\n\n\n\n<li><strong>Decide what you want to optimize<\/strong> (objective)<\/li>\n\n\n\n<li><strong>List rules you must follow<\/strong> (constraints)<\/li>\n\n\n\n<li><strong>Convert rules into penalties<\/strong><\/li>\n\n\n\n<li><strong>Combine everything into one formula<\/strong><\/li>\n<\/ol>\n\n\n\n<p>Now let\u2019s <strong>apply every step explicitly<\/strong>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Example 1: Choose Exactly One&nbsp;Drink<\/h3>\n\n\n\n<p>You have 3 drinks: Coke, Milk Tea, Orange Juice<\/p>\n\n\n\n<p>You want to choose <strong>exactly one<\/strong>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Step 1: List the&nbsp;Choices<\/h4>\n\n\n\n<p>Ask yourself:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><em>What are the Yes \/ No decisions?<\/em><\/p>\n<\/blockquote>\n\n\n\n<p>Choices:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Choose Coke?<\/li>\n\n\n\n<li>Choose Milk Tea?<\/li>\n\n\n\n<li>Choose Orange Juice?<\/li>\n<\/ul>\n\n\n\n<p>That\u2019s it. No math yet.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Step 2: Create Binary Variables<\/h4>\n\n\n\n<p>Turn each choice into a variable:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>C, M, O \u2208 {0,1}<\/code><\/pre>\n\n\n\n<p>Meaning:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>1 \u2192 chosen<\/li>\n\n\n\n<li>0 \u2192 not chosen<\/li>\n<\/ul>\n\n\n\n<p>So:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>C = 1 means Coke is chosen<\/li>\n\n\n\n<li>M = 1 means Milk Tea is chosen<\/li>\n\n\n\n<li>O = 1 means Orange Juice is chosen<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Step 3: Decide What You Want to&nbsp;Optimize<\/h4>\n\n\n\n<p>In this example:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You don\u2019t care which drink<\/li>\n\n\n\n<li>You just want <strong>one drink<\/strong><\/li>\n<\/ul>\n\n\n\n<p>So the objective can be <strong>zero<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> Objective = 0<\/code><\/pre>\n\n\n\n<p>This is normal. Not every problem needs rewards.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Step 4: List the&nbsp;Rules<\/h4>\n\n\n\n<p>Rule in human language:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><em>You must choose exactly one drink<\/em><\/p>\n<\/blockquote>\n\n\n\n<p>Translate to math:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>C + M + O = 1<\/code><\/pre>\n\n\n\n<p>Still not QUBO yet.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Step 5: Convert the Rule into a&nbsp;Penalty<\/h4>\n\n\n\n<p>QUBO cannot say \u201cforbidden\u201d. It only says:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><em>Break the rule \u2192 pay a cost<\/em><\/p>\n<\/blockquote>\n\n\n\n<p>We do this by squaring:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>(C + M + O \u2014 1)\u00b2<\/code><\/pre>\n\n\n\n<p>Why this works:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Rule satisfied \u2192 value = 0 (no penalty)<\/li>\n\n\n\n<li>Rule broken \u2192 value > 0 (penalty)<\/li>\n<\/ul>\n\n\n\n<p>We multiply by a penalty weight <code>P<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>P(C + M + O - 1)\u00b2<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Step 6: Combine Everything into One&nbsp;Formula<\/h4>\n\n\n\n<p>Final QUBO:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Q = P(C + M + O \u2014 1)\u00b2<\/code><\/pre>\n\n\n\n<p>This single formula fully describes the problem.<\/p>\n\n\n\n<p>A solver will try all combinations and pick:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>exactly one variable = 1<\/li>\n\n\n\n<li>others = 0<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Example 2: Prefer One&nbsp;Option<\/h3>\n\n\n\n<p>Now let\u2019s add <strong>preference<\/strong>.<\/p>\n\n\n\n<p>You like <strong>Coke<\/strong> more than the others.<\/p>\n\n\n\n<p><strong>Step 1<\/strong> and <strong>Step 2<\/strong> are same as Example 1 so let\u2019s jump to <strong>Step 3.<\/strong><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Step 3: Objective (Preference)<\/h4>\n\n\n\n<p>You like <strong>Coke<\/strong>, so reward it:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Objective = -3C<\/code><\/pre>\n\n\n\n<p>Negative = <strong>good<\/strong>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Step 4:&nbsp;Rule<\/h4>\n\n\n\n<p>Choose exactly one:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>C + M + O = 1<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Step 5:&nbsp;Penalty<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>P(C + M + O \u2014 1)\u00b2<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Step 6: Final&nbsp;QUBO<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>Q = -3C + P(C + M + O \u2014 1)\u00b2<\/code><\/pre>\n\n\n\n<p>Now the solver:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Must <strong>choose<\/strong> <strong>one<\/strong> drink<\/li>\n\n\n\n<li>Will prefer <strong>Coke<\/strong> if possible<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Example 3: Multiple&nbsp;Rules<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You <strong>preference<\/strong> Coke -> Orange juice -> Milk Tea<\/li>\n\n\n\n<li>You can choose <strong>at most 2 drinks<\/strong><\/li>\n\n\n\n<li>You <strong>cannot choose Coke and Orange juice together<\/strong><\/li>\n<\/ul>\n\n\n\n<p><strong>Step 1<\/strong> and <strong>Step 2<\/strong> are same as Example 1 &amp; 2 so let\u2019s jump to <strong>Step 3.<\/strong><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Step 3: Objective (Multiple rules)<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>Objective = -5C -3M -4O<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Step 4:&nbsp;Rules<\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li>At most <strong>2 drinks<\/strong>:<br>C + M+ O \u2264 2<\/li>\n\n\n\n<li><strong>Coke and Orange juice<\/strong> cannot both be chosen:<br>C + O \u2264 1<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\">Step 5: Penalties<\/h4>\n\n\n\n<p>Convert rules:<\/p>\n\n\n\n<p>P\u2081 for Rule 1:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>(C + M + O \u2014 2)\u00b2<\/code><\/pre>\n\n\n\n<p>P\u2082 for Rule 2:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>(C + O \u2014 1)\u00b2<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Step 6: Final&nbsp;QUBO<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>Q = -5C -3M -4O + P\u2081(C + M + O- 2)\u00b2 + P\u2082(C + O - 1)\u00b2<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Mental Shortcut (Very Important)<\/h3>\n\n\n\n<p>Whenever you face a new problem, ask:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>What are my Yes \/ No choices?<\/li>\n\n\n\n<li>What do I want more or less of?<\/li>\n\n\n\n<li>What must never happen?<\/li>\n\n\n\n<li>Which option do I prefer more than the others?<\/li>\n<\/ol>\n\n\n\n<p>If you can answer these three questions, you are already 80% done.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Final Thought<\/h3>\n\n\n\n<p>You\u2019re no longer memorizing formulas. You\u2019re <strong>thinking in patterns<\/strong>.<\/p>\n\n\n\n<p>In the next chapter, we\u2019ll:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Visualize QUBO as graphs<\/li>\n\n\n\n<li>Understand interactions intuitively<\/li>\n\n\n\n<li>Prepare for real solvers<\/li>\n<\/ul>\n\n\n\n<p>Keep going \ud83d\udc4d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>(From Daily Life to Math, Step by Step) QUBO is not about math first.QUBO is about thinking clearly. Goal of this chapter 1. The Universal QUBO Thinking&nbsp;Process No matter how complex a problem looks, QUBO modeling always follows the same steps: Now let\u2019s apply every step explicitly. Example 1: Choose Exactly One&nbsp;Drink You have 3 drinks: Coke, Milk Tea, Orange Juice You want to choose exactly one. Step 1: List the&nbsp;Choices Ask yourself: What are the Yes \/ No decisions? Choices: That\u2019s it. No math yet. Step 2: Create Binary Variables Turn each choice into a variable: Meaning: So: Step 3: Decide What You Want to&nbsp;Optimize In this example: So the objective can be zero: This is normal. Not every problem needs rewards. Step 4: List the&nbsp;Rules Rule in human language: You must choose exactly one drink Translate to math: Still not QUBO yet. Step 5: Convert the Rule into a&nbsp;Penalty QUBO cannot say \u201cforbidden\u201d. It only says: Break the rule \u2192 pay a cost We do this by squaring: Why this works: We multiply by a penalty weight P: Step 6: Combine Everything into One&nbsp;Formula Final QUBO: This single formula fully describes the problem. A solver will try all combinations and pick: Example 2: Prefer One&nbsp;Option Now let\u2019s add preference. You like Coke more than the others. Step 1 and Step 2 are same as Example 1 so let\u2019s jump to Step 3. Step 3: Objective (Preference) You like Coke, so reward it: Negative = good. Step 4:&nbsp;Rule Choose exactly one: Step 5:&nbsp;Penalty Step 6: Final&nbsp;QUBO Now the solver: Example 3: Multiple&nbsp;Rules Step 1 and Step 2 are same as Example 1 &amp; 2 so let\u2019s jump to Step 3. Step 3: Objective (Multiple rules) Step 4:&nbsp;Rules Step 5: Penalties Convert rules: P\u2081 for Rule 1: P\u2082 for Rule 2: Step 6: Final&nbsp;QUBO Mental Shortcut (Very Important) Whenever you face a new problem, ask: If you can answer these three questions, you are already 80% done. Final Thought You\u2019re no longer memorizing formulas. You\u2019re thinking in patterns. In the next chapter, we\u2019ll: Keep going \ud83d\udc4d<\/p>\n","protected":false},"author":1,"featured_media":45,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-44","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"jetpack_featured_media_url":"https:\/\/qc.thelazydreamer.com\/wp-content\/uploads\/2025\/12\/1_rlQTKewMPtheOuuJWR52hw.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/qc.thelazydreamer.com\/index.php?rest_route=\/wp\/v2\/posts\/44","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/qc.thelazydreamer.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qc.thelazydreamer.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qc.thelazydreamer.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/qc.thelazydreamer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=44"}],"version-history":[{"count":1,"href":"https:\/\/qc.thelazydreamer.com\/index.php?rest_route=\/wp\/v2\/posts\/44\/revisions"}],"predecessor-version":[{"id":47,"href":"https:\/\/qc.thelazydreamer.com\/index.php?rest_route=\/wp\/v2\/posts\/44\/revisions\/47"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/qc.thelazydreamer.com\/index.php?rest_route=\/wp\/v2\/media\/45"}],"wp:attachment":[{"href":"https:\/\/qc.thelazydreamer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=44"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qc.thelazydreamer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=44"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qc.thelazydreamer.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=44"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}