{"id":9129,"date":"2023-04-06T14:15:54","date_gmt":"2023-04-06T18:15:54","guid":{"rendered":"https:\/\/blogs.mathworks.com\/community\/?p=9129"},"modified":"2023-04-13T10:41:44","modified_gmt":"2023-04-13T14:41:44","slug":"an-algorithmic-spelling-bee","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/community\/2023\/04\/06\/an-algorithmic-spelling-bee\/","title":{"rendered":"An Algorithmic Spelling Bee"},"content":{"rendered":"<div class=\"rtcContent\">\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Earlier this year I wrote about solving word ladders with MATLAB. There was a lot of interest in that post, so I thought I'd share my investigations regarding another word-based app. In this script, I'm trying to create a puzzle modeled on the <a href=\"https:\/\/www.nytimes.com\/puzzles\/spelling-bee\">NY Times Spelling Bee<\/a> game. Here is the premise: you are given seven letters, and your job is to find all possible words you can make with those seven letters. You can use letters more than once, but they must be four or more letters long, and they must all include the special center letter. Every Spelling Bee puzzle has at least one \"pangram\", which is a word that uses all seven letters.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">As an example, suppose you were given this puzzle.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><img decoding=\"async\" loading=\"lazy\" class=\"imageNode\" style=\"vertical-align: baseline; width: 199px; height: 207px;\" src=\"https:\/\/blogs.mathworks.com\/community\/files\/spelling_bee_1.png\" alt=\"spellingbee.png\" width=\"199\" height=\"207\" \/><\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">From this puzzle you could create PORE, ADORE, ADOPT, as well as the pangram OPERATED. But you couldn't create POD (too short) or PAPER (doesn't include the center letter \"O\").<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Here I'm not so much interested in solving the puzzle. I want to write a script that can create a Spelling Bee puzzle.<\/div>\n<h2 style=\"margin: 3px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;\">Build the Dictionary<\/h2>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">We need some ground truth for all the legal words. Here's Google's 10,000 word English dictionary. It's small, but good enough for our purposes here.<\/div>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 1px solid #d9d9d9; border-bottom: 0px none #212121; border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">url = <span style=\"color: #a709f5;\">'https:\/\/raw.githubusercontent.com\/first20hours\/google-10000-english\/master\/google-10000-english.txt'<\/span>;<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 1px solid #d9d9d9; border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">wordList = webread(url);<\/span><\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Split the word list into strings.<\/div>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 1px solid #d9d9d9; border-bottom: 0px none #212121; border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">words = split(string(wordList));<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 1px solid #d9d9d9; border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">words = lower(words);<\/span><\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">The Spelling Bee puzzle avoids the letter S so that it never has to deal with plurals. Let's use logical indexing to keep only the words that don't contain an S.<\/div>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 1px solid #d9d9d9; border-bottom: 0px none #212121; border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">keep = ~words.contains(<span style=\"color: #a709f5;\">\"s\"<\/span>);<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 1px solid #d9d9d9; border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">words = words(keep);<\/span><\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Of these, keep only the words that are four letters or longer.<\/div>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 1px solid #d9d9d9; border-bottom: 0px none #212121; border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">keep = words.strlength &gt;= 4;<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 1px solid #d9d9d9; border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">words = words(keep);<\/span><\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">I like how these string commands are easy to read and understand! Just like for us humans, code that communicates clearly keeps its job the longest. We don't want to employ fussy, high-maintenance code.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">How many words do we end up with?<\/div>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper outputs\">\n<div style=\"border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px; border: 1px solid #d9d9d9;\"><span style=\"white-space: pre;\">fprintf(<span style=\"color: #a709f5;\">\"The adjusted dictionary now contains %d words\\n\"<\/span>,length(words))<\/span><\/div>\n<div style=\"color: #212121; padding: 10px 0px 6px 17px; background: #ffffff none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px;\">\n<div class=\"inlineElement eoOutputWrapper embeddedOutputsTextElement\" style=\"width: 1139px; white-space: pre; font-style: normal; color: #212121; font-size: 12px;\" data-testid=\"output_0\">\n<div class=\"textElement eoOutputContent\" style=\"max-height: 261px; white-space: pre; font-style: normal; color: #212121; font-size: 12px;\" data-previous-available-width=\"1109\" data-previous-scroll-height=\"17\" data-hashorizontaloverflow=\"false\">The adjusted dictionary now contains 4955 words<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">We've thrown out about half the words in our dictionary.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">We'll be converting from ASCII representation to alphabet number a few times, so let's invest in a little anonymous helper function. It'll make the code below a little easier to read.<\/div>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 1px solid #d9d9d9; border-bottom: 0px none #212121; border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"><span style=\"color: #008013;\">% An anonymous function to translate ASCII values to A=1, B=2, ... Z=26.<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 1px solid #d9d9d9; border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">ascii2letter = @(chars) abs(lower(chars))-96;<\/span><\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Try it out<\/div>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper outputs\">\n<div style=\"border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px; border: 1px solid #d9d9d9;\"><span style=\"white-space: pre;\">ascii2letter(<span style=\"color: #a709f5;\">'ABCXYZ'<\/span>)<\/span><\/div>\n<div style=\"color: #212121; padding: 10px 0px 6px 17px; background: #ffffff none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px;\">\n<div class=\"inlineElement eoOutputWrapper embeddedOutputsVariableMatrixElement\" style=\"width: 1139px; white-space: normal; font-style: normal; color: #212121; font-size: 12px;\" data-testid=\"output_1\" data-width=\"1109\">\n<div class=\"matrixElement veSpecifier saveLoad eoOutputContent\" style=\"white-space: normal; font-style: normal; color: #212121; font-size: 12px;\">\n<div class=\"veVariableName variableNameElement double\" style=\"width: 1109px; white-space: normal; font-style: normal; color: #212121; font-size: 12px;\">\n<div class=\"headerElementClickToInteract\" style=\"white-space: normal; font-style: normal; color: #212121; font-size: 12px;\"><span style=\"white-space: normal; font-style: normal; color: #212121; font-size: 12px;\">ans = <\/span><span class=\"veVariableValueSummary veMetaSummary\" style=\"white-space: normal; font-style: italic; color: #616161; font-size: 12px;\">1\u00d76<\/span><\/div>\n<\/div>\n<div class=\"valueContainer\" style=\"white-space: nowrap; font-style: normal; color: #212121; font-size: 12px;\" data-layout=\"{&quot;columnWidth&quot;:40,&quot;totalColumns&quot;:&quot;6&quot;,&quot;totalRows&quot;:&quot;1&quot;,&quot;charsPerColumn&quot;:6}\">\n<div class=\"variableValue\" style=\"width: 242px; white-space: pre; font-style: normal; color: #212121; font-size: 12px;\">1 2 3 24 25 26<\/div>\n<div class=\"horizontalEllipsis hide\" style=\"white-space: nowrap; font-style: normal; color: #212121; font-size: 12px;\"><\/div>\n<div class=\"verticalEllipsis hide\" style=\"white-space: nowrap; font-style: normal; color: #212121; font-size: 12px;\"><\/div>\n<\/div>\n<\/div>\n<div class=\"outputLayer selectedOutputDecorationLayer doNotExport\" style=\"white-space: normal; font-style: normal; color: #212121; font-size: 12px;\"><\/div>\n<div class=\"outputLayer activeOutputDecorationLayer doNotExport\" style=\"white-space: normal; font-style: normal; color: #212121; font-size: 12px;\"><\/div>\n<div class=\"outputLayer scrollableOutputDecorationLayer doNotExport\" style=\"white-space: normal; font-style: normal; color: #212121; font-size: 12px;\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Looks good!<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Build a 26-column sparse matrix to represent unique letter usage for each word. Each word in the dictionary gets one row. Every letter that appears in the word gets a 1.<\/div>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 1px solid #d9d9d9; border-bottom: 0px none #212121; border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">dictionaryLength = numel(words);<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">a = sparse(dictionaryLength,26);<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"><span style=\"color: #0e00ff;\">for <\/span>i = 1:dictionaryLength<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> uniqueLetters = unique(words(i).char);<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> a(i,ascii2letter(uniqueLetters)) = 1;<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"><span style=\"color: #0e00ff;\">end<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><\/div>\n<\/div>\n<div class=\"inlineWrapper outputs\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 1px solid #d9d9d9; border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">nnz(a)\/numel(a)<\/span><\/div>\n<div style=\"color: #212121; padding: 10px 0px 6px 17px; background: #ffffff none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px;\">\n<div class=\"variableElement\" style=\"font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 12px;\">ans = 0.2218<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">At 22% full, this matrix isn't terribly sparse as sparse matrices go. But it's a fun excuse to play with SPARSE, so let's carry on. Here's a SPY plot of the matrix.<\/div>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 1px solid #d9d9d9; border-bottom: 0px none #212121; border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">spy(a)<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">set(gca, <span style=\"color: #0e00ff;\">...<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> XTick=1:26, <span style=\"color: #0e00ff;\">...<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> XTickLabel=num2cell(<span style=\"color: #a709f5;\">'A'<\/span>:<span style=\"color: #a709f5;\">'Z'<\/span>), <span style=\"color: #0e00ff;\">...<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> XTickLabelRotation=0, <span style=\"color: #0e00ff;\">...<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> XAxisLocation=<span style=\"color: #a709f5;\">\"top\"<\/span>, <span style=\"color: #0e00ff;\">...<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper outputs\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 1px solid #d9d9d9; border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> PlotBoxAspectRatio=[1 1 1])<\/span><\/div>\n<div style=\"color: #212121; padding: 10px 0px 6px 17px; background: #ffffff none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px;\">\n<div class=\"inlineElement eoOutputWrapper embeddedOutputsFigure\" style=\"width: 1139px;\" data-testid=\"output_3\">\n<div class=\"figureElement eoOutputContent\"><img decoding=\"async\" class=\"figureImage figureContainingNode\" style=\"width: 559px; padding-bottom: 0px;\" src=\"https:\/\/blogs.mathworks.com\/community\/files\/spelling_bee_2.png\" \/><\/div>\n<div class=\"outputLayer selectedOutputDecorationLayer doNotExport\"><\/div>\n<div class=\"outputLayer activeOutputDecorationLayer doNotExport\"><\/div>\n<div class=\"outputLayer scrollableOutputDecorationLayer doNotExport\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">To make much out of this, we need to zoom in. Let's see how the word LABEL is encoded.<\/div>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 1px solid #d9d9d9; border-bottom: 0px none #212121; border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">ix = 1002;<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"><span style=\"color: #008013;\">% In case you're wondering, I like to use \"ix\" as short for \"index\"<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper outputs\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 1px solid #d9d9d9; border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">words(ix)<\/span><\/div>\n<div style=\"color: #212121; padding: 10px 0px 6px 17px; background: #ffffff none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px;\">\n<div class=\"inlineElement eoOutputWrapper embeddedOutputsVariableStringElement\" style=\"width: 1139px; white-space: pre; font-style: normal; color: #212121; font-size: 12px;\" data-testid=\"output_4\">\n<div class=\"textElement eoOutputContent\" style=\"max-height: 261px; white-space: pre; font-style: normal; color: #212121; font-size: 12px;\" data-previous-available-width=\"1109\" data-previous-scroll-height=\"20\" data-hashorizontaloverflow=\"false\">\n<div style=\"white-space: pre; font-style: normal; color: #212121; font-size: 12px;\"><span class=\"variableNameElement\" style=\"white-space: pre; font-style: normal; color: #212121; font-size: 12px;\">ans = <\/span>\"label\"<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"inlineWrapper outputs\">\n<div style=\"border-radius: 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px; border: 1px solid #d9d9d9;\"><span style=\"white-space: pre;\">full(a(ix,:))<\/span><\/div>\n<div style=\"color: #212121; padding: 10px 0px 6px 17px; background: #ffffff none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px;\">\n<div class=\"inlineElement eoOutputWrapper embeddedOutputsVariableMatrixElement\" style=\"width: 1139px; white-space: normal; font-style: normal; color: #212121; font-size: 12px;\" data-testid=\"output_5\" data-width=\"1109\">\n<div class=\"matrixElement veSpecifier saveLoad eoOutputContent\" style=\"white-space: normal; font-style: normal; color: #212121; font-size: 12px;\">\n<div class=\"veVariableName variableNameElement double\" style=\"width: 1109px; white-space: normal; font-style: normal; color: #212121; font-size: 12px;\">\n<div class=\"headerElementClickToInteract\" style=\"white-space: normal; font-style: normal; color: #212121; font-size: 12px;\"><span style=\"white-space: normal; font-style: normal; color: #212121; font-size: 12px;\">ans = <\/span><span class=\"veVariableValueSummary veMetaSummary\" style=\"white-space: normal; font-style: italic; color: #616161; font-size: 12px;\">1\u00d726<\/span><\/div>\n<\/div>\n<div class=\"valueContainer\" style=\"white-space: nowrap; font-style: normal; color: #212121; font-size: 12px;\" data-layout=\"{&quot;columnWidth&quot;:40,&quot;totalColumns&quot;:&quot;26&quot;,&quot;totalRows&quot;:&quot;1&quot;,&quot;charsPerColumn&quot;:6}\">\n<div class=\"variableValue\" style=\"width: 1042px; white-space: pre; font-style: normal; color: #212121; font-size: 12px;\">1 1 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0<\/div>\n<div class=\"horizontalEllipsis hide\" style=\"white-space: nowrap; font-style: normal; color: #212121; font-size: 12px;\"><\/div>\n<div class=\"verticalEllipsis hide\" style=\"white-space: nowrap; font-style: normal; color: #212121; font-size: 12px;\"><\/div>\n<\/div>\n<\/div>\n<div class=\"outputLayer selectedOutputDecorationLayer doNotExport\" style=\"white-space: normal; font-style: normal; color: #212121; font-size: 12px;\"><\/div>\n<div class=\"outputLayer activeOutputDecorationLayer doNotExport\" style=\"white-space: normal; font-style: normal; color: #212121; font-size: 12px;\"><\/div>\n<div class=\"outputLayer scrollableOutputDecorationLayer doNotExport\" style=\"white-space: normal; font-style: normal; color: #212121; font-size: 12px;\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 1px solid #d9d9d9; border-bottom: 0px none #212121; border-radius: 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">spy(a(1001:1010,:))<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">xline([1 2 5 12])<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">yline(2,Color=<span style=\"color: #a709f5;\">\"red\"<\/span>)<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">set(gca, <span style=\"color: #0e00ff;\">...<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> XTick=1:26, <span style=\"color: #0e00ff;\">...<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> XTickLabel=num2cell(<span style=\"color: #a709f5;\">'A'<\/span>:<span style=\"color: #a709f5;\">'Z'<\/span>), <span style=\"color: #0e00ff;\">...<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> XTickLabelRotation=0, <span style=\"color: #0e00ff;\">...<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> XAxisLocation=<span style=\"color: #a709f5;\">\"top\"<\/span>, <span style=\"color: #0e00ff;\">...<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> YTick=1:10, <span style=\"color: #0e00ff;\">...<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper outputs\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 1px solid #d9d9d9; border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> YTickLabels=words(1001:1010))<\/span><\/div>\n<div style=\"color: #212121; padding: 10px 0px 6px 17px; background: #ffffff none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px;\">\n<div class=\"inlineElement eoOutputWrapper embeddedOutputsFigure\" style=\"width: 1139px;\" data-testid=\"output_6\">\n<div class=\"figureElement eoOutputContent\"><img decoding=\"async\" class=\"figureImage figureContainingNode\" style=\"width: 559px; padding-bottom: 0px;\" src=\"https:\/\/blogs.mathworks.com\/community\/files\/spelling_bee_3.png\" \/><\/div>\n<div class=\"outputLayer selectedOutputDecorationLayer doNotExport\"><\/div>\n<div class=\"outputLayer activeOutputDecorationLayer doNotExport\"><\/div>\n<div class=\"outputLayer scrollableOutputDecorationLayer doNotExport\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Note that even though the L appears twice in the word, it only has a one in the matrix.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Just for fun, let's do a histogram of the letters. This can be a useful sanity check that we're on the right track.<\/div>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 1px solid #d9d9d9; border-bottom: 0px none #212121; border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">allLetters = ascii2letter(char(join(words,<span style=\"color: #a709f5;\">''<\/span>)));<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">histogram(allLetters)<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">set(gca, <span style=\"color: #0e00ff;\">...<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> XTick=1:26, <span style=\"color: #0e00ff;\">...<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> XTickLabel=num2cell(<span style=\"color: #a709f5;\">'A'<\/span>:<span style=\"color: #a709f5;\">'Z'<\/span>), <span style=\"color: #0e00ff;\">...<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper outputs\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 1px solid #d9d9d9; border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> XTickLabelRotation=0)<\/span><\/div>\n<div style=\"color: #212121; padding: 10px 0px 6px 17px; background: #ffffff none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px;\">\n<div class=\"inlineElement eoOutputWrapper embeddedOutputsFigure\" style=\"width: 1139px;\" data-testid=\"output_7\">\n<div class=\"figureElement eoOutputContent\"><img decoding=\"async\" class=\"figureImage figureContainingNode\" style=\"width: 559px; padding-bottom: 0px;\" src=\"https:\/\/blogs.mathworks.com\/community\/files\/spelling_bee_4.png\" \/><\/div>\n<div class=\"outputLayer selectedOutputDecorationLayer doNotExport\"><\/div>\n<div class=\"outputLayer activeOutputDecorationLayer doNotExport\"><\/div>\n<div class=\"outputLayer scrollableOutputDecorationLayer doNotExport\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">As expected, E is the most commonly appearing letter. Q is the least, but for the fact that we completely wiped out S.<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">How many words are composed of exactly seven distinct letters? That is, how many are potential pangrams for a game?<\/div>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 1px solid #d9d9d9; border-bottom: 0px none #212121; border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"><span style=\"color: #008013;\">% Summing letter-use across the rows<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"><span style=\"color: #008013;\">% Use FIND to build an index to all the words that use exactly seven letters<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">ix7LetterWords = find(sum(a,2)==7);<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper outputs\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 1px solid #d9d9d9; border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">length(ix7LetterWords)<\/span><\/div>\n<div style=\"color: #212121; padding: 10px 0px 6px 17px; background: #ffffff none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px;\">\n<div class=\"variableElement\" style=\"font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 12px;\">ans = 790<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Let's look at a few of these seven-letter words.<\/div>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 1px solid #d9d9d9; border-bottom: 0px none #212121; border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">num7LetterWords = numel(ix7LetterWords);<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">ix = ix7LetterWords(1:10);<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper outputs\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 1px solid #d9d9d9; border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">disp(words(ix(1:10)))<\/span><\/div>\n<div style=\"color: #212121; padding: 10px 0px 6px 17px; background: #ffffff none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px;\">\n<div class=\"inlineElement eoOutputWrapper embeddedOutputsTextElement\" style=\"width: 1139px; white-space: pre; font-style: normal; color: #212121; font-size: 12px;\" data-testid=\"output_9\">\n<div class=\"textElement eoOutputContent\" style=\"max-height: 261px; white-space: pre; font-style: normal; color: #212121; font-size: 12px;\" data-previous-available-width=\"1109\" data-previous-scroll-height=\"150\" data-hashorizontaloverflow=\"false\">\"product\"<br \/>\n\"privacy\"<br \/>\n\"company\"<br \/>\n\"project\"<br \/>\n\"american\"<br \/>\n\"network\"<br \/>\n\"following\"<br \/>\n\"including\"<br \/>\n\"location\"<br \/>\n\"profile\"<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Pick a good one as the \"seed\" pangram for our game.<\/div>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 1px solid #d9d9d9; border-bottom: 0px none #212121; border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">ix = ix(9);<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper outputs\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 1px solid #d9d9d9; border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">disp(words(ix))<\/span><\/div>\n<div style=\"color: #212121; padding: 10px 0px 6px 17px; background: #ffffff none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px;\">\n<div class=\"inlineElement eoOutputWrapper embeddedOutputsTextElement\" style=\"width: 1139px; white-space: pre; font-style: normal; color: #212121; font-size: 12px;\" data-testid=\"output_10\">\n<div class=\"textElement eoOutputContent\" style=\"max-height: 261px; white-space: pre; font-style: normal; color: #212121; font-size: 12px;\" data-previous-available-width=\"1109\" data-previous-scroll-height=\"17\" data-hashorizontaloverflow=\"false\">location<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">How many words can be spelled from those same 7 letters? Find all the words that use nothing but the letters in the seed word<\/div>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 1px solid #d9d9d9; border-bottom: 0px none #212121; border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">lettersInSeedWord = a(ix,:);<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"><span style=\"color: #008013;\">% Find all the words that have none of the letters from the seed word.<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"><span style=\"color: #008013;\">% We're making sure that all contributions of letters other than<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"><span style=\"color: #008013;\">% the seed letters sum to zero.<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">ixWordsFromSeedWord = find(sum(a(:,~lettersInSeedWord),2) == 0);<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><\/div>\n<\/div>\n<div class=\"inlineWrapper outputs\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 1px solid #d9d9d9; border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">fprintf(<span style=\"color: #a709f5;\">'%d words use only the seven letters appearing in the seed word.\\n'<\/span>,numel(ixWordsFromSeedWord))<\/span><\/div>\n<div style=\"color: #212121; padding: 10px 0px 6px 17px; background: #ffffff none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px;\">\n<div class=\"inlineElement eoOutputWrapper embeddedOutputsTextElement\" style=\"width: 1139px; white-space: pre; font-style: normal; color: #212121; font-size: 12px;\" data-testid=\"output_11\">\n<div class=\"textElement eoOutputContent\" style=\"max-height: 261px; white-space: pre; font-style: normal; color: #212121; font-size: 12px;\" data-previous-available-width=\"1109\" data-previous-scroll-height=\"17\" data-hashorizontaloverflow=\"false\">73 words use only the seven letters appearing in the seed word.<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Which letters appear most frequently?<\/div>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 1px solid #d9d9d9; border-bottom: 0px none #212121; border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">bar(sum(a(ixWordsFromSeedWord,:)))<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">set(gca, <span style=\"color: #0e00ff;\">...<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> XTick=1:26, <span style=\"color: #0e00ff;\">...<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> XTickLabel=num2cell(<span style=\"color: #a709f5;\">'A'<\/span>:<span style=\"color: #a709f5;\">'Z'<\/span>), <span style=\"color: #0e00ff;\">...<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper outputs\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 1px solid #d9d9d9; border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> XTickLabelRotation=0)<\/span><\/div>\n<div style=\"color: #212121; padding: 10px 0px 6px 17px; background: #ffffff none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px;\">\n<div class=\"inlineElement eoOutputWrapper embeddedOutputsFigure\" style=\"width: 1139px;\" data-testid=\"output_12\">\n<div class=\"figureElement eoOutputContent\"><img decoding=\"async\" class=\"figureImage figureContainingNode\" style=\"width: 559px; padding-bottom: 0px;\" src=\"https:\/\/blogs.mathworks.com\/community\/files\/spelling_bee_5.png\" \/><\/div>\n<div class=\"outputLayer selectedOutputDecorationLayer doNotExport\"><\/div>\n<div class=\"outputLayer activeOutputDecorationLayer doNotExport\"><\/div>\n<div class=\"outputLayer scrollableOutputDecorationLayer doNotExport\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">We need to designate one letter as the \"center letter\" that must appear in every word. Let's pick the letter that appears least frequently.<\/div>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 1px solid #d9d9d9; border-bottom: 0px none #212121; border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">vals = full(sum(a(ixWordsFromSeedWord,:)));<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">vals(vals==0) = inf;<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">[~,ixlet] = min(vals);<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 1px solid #d9d9d9; border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">centerLetter = char(ixlet+96);<\/span><\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Remove all the words that don't have this letter<\/div>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 1px solid #d9d9d9; border-bottom: 0px none #212121; border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">ixRequired = find(a(:,ixlet));<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 1px solid #d9d9d9; border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">ix2a = intersect(ixWordsFromSeedWord,ixRequired);<\/span><\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">This is the original seed word:<\/div>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper outputs\">\n<div style=\"border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px; border: 1px solid #d9d9d9;\"><span style=\"white-space: pre;\">fprintf(<span style=\"color: #a709f5;\">\"%s\\n\"<\/span>, words(ix))<\/span><\/div>\n<div style=\"color: #212121; padding: 10px 0px 6px 17px; background: #ffffff none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px;\">\n<div class=\"inlineElement eoOutputWrapper embeddedOutputsTextElement\" style=\"width: 1139px; white-space: pre; font-style: normal; color: #212121; font-size: 12px;\" data-testid=\"output_13\">\n<div class=\"textElement eoOutputContent\" style=\"max-height: 261px; white-space: pre; font-style: normal; color: #212121; font-size: 12px;\" data-previous-available-width=\"1109\" data-previous-scroll-height=\"17\" data-hashorizontaloverflow=\"false\">location<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Here are the seven unique letters:<\/div>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 1px solid #d9d9d9; border-bottom: 0px none #212121; border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">sevenLetters = unique(char(words(ix)));<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper outputs\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 1px solid #d9d9d9; border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">fprintf(<span style=\"color: #a709f5;\">\"%s\\n\"<\/span>, sevenLetters);<\/span><\/div>\n<div style=\"color: #212121; padding: 10px 0px 6px 17px; background: #ffffff none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px;\">\n<div class=\"inlineElement eoOutputWrapper embeddedOutputsTextElement\" style=\"width: 1139px; white-space: pre; font-style: normal; color: #212121; font-size: 12px;\" data-testid=\"output_14\">\n<div class=\"textElement eoOutputContent\" style=\"max-height: 261px; white-space: pre; font-style: normal; color: #212121; font-size: 12px;\" data-previous-available-width=\"1109\" data-previous-scroll-height=\"17\" data-hashorizontaloverflow=\"false\">acilnot<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">The required center letter is:<\/div>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper outputs\">\n<div style=\"border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px; border: 1px solid #d9d9d9;\"><span style=\"white-space: pre;\">fprintf(<span style=\"color: #a709f5;\">\"%s\\n\"<\/span>, upper(centerLetter));<\/span><\/div>\n<div style=\"color: #212121; padding: 10px 0px 6px 17px; background: #ffffff none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px;\">\n<div class=\"inlineElement eoOutputWrapper embeddedOutputsTextElement\" style=\"width: 1139px; white-space: pre; font-style: normal; color: #212121; font-size: 12px;\" data-testid=\"output_15\">\n<div class=\"textElement eoOutputContent\" style=\"max-height: 261px; white-space: pre; font-style: normal; color: #212121; font-size: 12px;\" data-previous-available-width=\"1109\" data-previous-scroll-height=\"17\" data-hashorizontaloverflow=\"false\">C<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Here are the pangrams<\/div>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 1px solid #d9d9d9; border-bottom: 0px none #212121; border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">ix3 = find(sum(a(ix2a,:),2)==7);<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"><span style=\"color: #0e00ff;\">for <\/span>i = 1:numel(ix3)<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> fprintf(<span style=\"color: #a709f5;\">\"%s\\n\"<\/span>,words(ix2a(ix3(i))));<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper outputs\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 1px solid #d9d9d9; border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"><span style=\"color: #0e00ff;\">end<\/span><\/span><\/div>\n<div style=\"color: #212121; padding: 10px 0px 6px 17px; background: #ffffff none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px;\">\n<div class=\"inlineElement eoOutputWrapper embeddedOutputsTextElement\" style=\"width: 1139px; white-space: pre; font-style: normal; color: #212121; font-size: 12px;\" data-testid=\"output_16\">\n<div class=\"textElement eoOutputContent\" style=\"max-height: 261px; white-space: pre; font-style: normal; color: #212121; font-size: 12px;\" data-previous-available-width=\"1109\" data-previous-scroll-height=\"46\" data-hashorizontaloverflow=\"false\">location<br \/>\ncoalition<br \/>\nallocation<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Here is the complete list of words<\/div>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 1px solid #d9d9d9; border-bottom: 0px none #212121; border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"><span style=\"color: #0e00ff;\">for <\/span>i = 1:numel(ix2a)<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> fprintf(<span style=\"color: #a709f5;\">\"%s\\n\"<\/span>,words(ix2a(i)));<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper outputs\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 1px solid #d9d9d9; border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"><span style=\"color: #0e00ff;\">end<\/span><\/span><\/div>\n<div style=\"color: #212121; padding: 10px 0px 6px 17px; background: #ffffff none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px;\">\n<div class=\"inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput\" style=\"width: 1139px; white-space: pre; font-style: normal; color: #212121; font-size: 12px;\" data-testid=\"output_17\">\n<div class=\"textElement eoOutputContent scrollArea\" style=\"max-height: 261px; white-space: pre; font-style: normal; color: #212121; font-size: 12px;\" data-previous-available-width=\"1109\" data-previous-scroll-height=\"504\" data-hashorizontaloverflow=\"false\">contact<br \/>\nlocal<br \/>\nlocation<br \/>\ncall<br \/>\naction<br \/>\ncool<br \/>\nclinical<br \/>\ncanon<br \/>\nicon<br \/>\ncontain<br \/>\natlantic<br \/>\ncotton<br \/>\nlincoln<br \/>\nclinton<br \/>\ncincinnati<br \/>\nclinic<br \/>\ncoalition<br \/>\ncoat<br \/>\nallocation<br \/>\nncaa<br \/>\ncoal<br \/>\noclc<br \/>\ncoin<br \/>\ncitation<br \/>\ncolin<br \/>\nciao<br \/>\ncant<br \/>\ncanal<br \/>\ncolonial<br \/>\nclan<br \/>\nitalic<br \/>\nincl<br \/>\ncolon<br \/>\ncannon<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Some of those are little odd, but we have our dictionary to thank for that.<\/div>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 1px solid #d9d9d9; border-bottom: 0px none #212121; border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">sixLetters = setdiff(sevenLetters,centerLetter);<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 1px solid #d9d9d9; border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">sixLetters = sixLetters(randperm(6));<\/span><\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Now for the graphics! Make the plot<\/div>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 1px solid #d9d9d9; border-bottom: 0px none #212121; border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"><span style=\"color: #008013;\">% The perimeter hex cells are centered from pi\/6 to 11*pi\/6 radians<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">t = 2*pi*(0:5)\/6 + 2*pi\/12;<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">r = 1.08*sqrt(3);<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">x = r*cos(t);<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">y = r*sin(t);<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">cla<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">hexplot(0,0,upper(centerLetter),<span style=\"color: #a709f5;\">\"#F7DA21\"<\/span>)<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">hold <span style=\"color: #a709f5;\">on<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"><span style=\"color: #0e00ff;\">for <\/span>i = 1:numel(x)<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> hexplot(x(i),y(i),upper(sixLetters(i)),<span style=\"color: #a709f5;\">\"#E6E6E6\"<\/span>)<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"><span style=\"color: #0e00ff;\">end<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">hold <span style=\"color: #a709f5;\">off<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">axis <span style=\"color: #a709f5;\">equal<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper outputs\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 1px solid #d9d9d9; border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\">axis <span style=\"color: #a709f5;\">off<\/span><\/span><\/div>\n<div style=\"color: #212121; padding: 10px 0px 6px 17px; background: #ffffff none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px;\">\n<div class=\"inlineElement eoOutputWrapper embeddedOutputsFigure\" style=\"width: 1139px;\" data-testid=\"output_18\">\n<div class=\"figureElement eoOutputContent\"><img decoding=\"async\" class=\"figureImage figureContainingNode\" style=\"width: 559px; padding-bottom: 0px;\" src=\"https:\/\/blogs.mathworks.com\/community\/files\/spelling_bee_6.png\" \/><\/div>\n<div class=\"outputLayer selectedOutputDecorationLayer doNotExport\"><\/div>\n<div class=\"outputLayer activeOutputDecorationLayer doNotExport\"><\/div>\n<div class=\"outputLayer scrollableOutputDecorationLayer doNotExport\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">And there you have it! It's easy to see how valuable a good algorithmically generated game can be. Once you've worked out the logic, you just need to run it once every day and your puzzle is ready to go. Compare this with the labor that goes into a crossword puzzle. Although who knows? Maybe crossword puzzles will be yet another of those things that AI proves to be adept at.<\/div>\n<div style=\"background-color: #f5f5f5; margin: 10px 0 10px 0;\">\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 1px solid #d9d9d9; border-bottom: 0px none #212121; border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"><span style=\"color: #0e00ff;\">function <\/span>hexplot(x,y,letter,color)<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> t = linspace(0,2*pi,7);<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> patch(cos(t)+x,sin(t)+y,<span style=\"color: #a709f5;\">\"white\"<\/span>, <span style=\"color: #0e00ff;\">...<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> EdgeColor=<span style=\"color: #a709f5;\">\"none\"<\/span>, <span style=\"color: #0e00ff;\">...<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> FaceColor=color)<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> text(x,y,letter, <span style=\"color: #0e00ff;\">...<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> FontSize=24, <span style=\"color: #0e00ff;\">...<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> FontWeight=<span style=\"color: #a709f5;\">\"bold\"<\/span>, <span style=\"color: #0e00ff;\">...<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> HorizontalAlignment=<span style=\"color: #a709f5;\">\"center\"<\/span>, <span style=\"color: #0e00ff;\">...<\/span><\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 0px none #212121; border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"> VerticalAlignment=<span style=\"color: #a709f5;\">\"middle\"<\/span>)<\/span><\/div>\n<\/div>\n<div class=\"inlineWrapper\">\n<div style=\"border-left: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; border-top: 0px none #212121; border-bottom: 1px solid #d9d9d9; border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 14px;\"><span style=\"white-space: pre;\"><span style=\"color: #0e00ff;\">end<\/span><\/span><\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><script type=\"text\/javascript\">var css = '\/* Styling that is common to warnings and errors is in diagnosticOutput.css *\/.embeddedOutputsErrorElement {    min-height: 18px;    max-height: 550px;} .embeddedOutputsErrorElement .diagnosticMessage-errorType {    overflow: auto;} .embeddedOutputsErrorElement.inlineElement {} .embeddedOutputsErrorElement.rightPaneElement {} \/* Styling that is common to warnings and errors is in diagnosticOutput.css *\/.embeddedOutputsWarningElement {    min-height: 18px;    max-height: 550px;} .embeddedOutputsWarningElement .diagnosticMessage-warningType {    overflow: auto;} .embeddedOutputsWarningElement.inlineElement {} .embeddedOutputsWarningElement.rightPaneElement {} \/* Copyright 2015-2022 The MathWorks, Inc. *\/\/* In this file, styles are not scoped to rtcContainer since they could be in the Dojo Tooltip *\/.diagnosticMessage-wrapper {    font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace;    font-size: 12px;} .diagnosticMessage-wrapper.diagnosticMessage-warningType {    color: var(--mw-color-matlabWarning);} .diagnosticMessage-wrapper.diagnosticMessage-warningType a {    color: var(--mw-color-matlabWarning);    text-decoration: underline;} .rtcThemeDefaultOverride .diagnosticMessage-wrapper.diagnosticMessage-warningType,.rtcThemeDefaultOverride .diagnosticMessage-wrapper.diagnosticMessage-warningType a {    color: var(--mw-color-matlabWarning) !important;} .diagnosticMessage-wrapper.diagnosticMessage-errorType {    color: var(--mw-color-matlabErrors);} .diagnosticMessage-wrapper.diagnosticMessage-errorType a {    color: var(--mw-color-matlabErrors);    text-decoration: underline;} .rtcThemeDefaultOverride .diagnosticMessage-wrapper.diagnosticMessage-errorType,.rtcThemeDefaultOverride .diagnosticMessage-wrapper.diagnosticMessage-errorType a {    color: var(--mw-color-matlabErrors) !important;} .diagnosticMessage-wrapper .diagnosticMessage-messagePart,.diagnosticMessage-wrapper .diagnosticMessage-causePart {    white-space: pre-wrap;} .diagnosticMessage-wrapper .diagnosticMessage-stackPart {    white-space: pre;} .embeddedOutputsTextElement,.embeddedOutputsVariableStringElement {    white-space: pre;    word-wrap:  initial;    min-height: 18px;    max-height: 550px;} .embeddedOutputsTextElement .textElement,.embeddedOutputsVariableStringElement .textElement {    overflow: auto;} .textElement,.rtcDataTipElement .textElement {    padding-top: 2px;} .embeddedOutputsTextElement.inlineElement,.embeddedOutputsVariableStringElement.inlineElement {} .inlineElement .textElement {} .embeddedOutputsTextElement.rightPaneElement,.embeddedOutputsVariableStringElement.rightPaneElement {    min-height: 16px;} .rightPaneElement .textElement {    padding-top: 2px;    padding-left: 9px;} .variableValue { width: 100% !important; } .embeddedOutputsMatrixElement,.eoOutputWrapper .matrixElement {    min-height: 18px;    box-sizing: border-box;} .embeddedOutputsMatrixElement .matrixElement,.eoOutputWrapper  .matrixElement,.rtcDataTipElement .matrixElement {    position: relative;} .matrixElement .variableValue,.rtcDataTipElement .matrixElement .variableValue {    white-space: pre;    display: inline-block;    vertical-align: top;    overflow: hidden;} .embeddedOutputsMatrixElement.inlineElement {} .embeddedOutputsMatrixElement.inlineElement .topHeaderWrapper {    display: none;} .embeddedOutputsMatrixElement.inlineElement .veTable .body {    padding-top: 0 !important;    max-height: 100px;} .inlineElement .matrixElement {    max-height: 300px;} .embeddedOutputsMatrixElement.rightPaneElement {} .rightPaneElement .matrixElement,.rtcDataTipElement .matrixElement {    overflow: hidden;    padding-left: 9px;} .rightPaneElement .matrixElement {    margin-bottom: -1px;} .embeddedOutputsMatrixElement .matrixElement .valueContainer,.eoOutputWrapper .matrixElement .valueContainer,.rtcDataTipElement .matrixElement .valueContainer {    white-space: nowrap;    margin-bottom: 3px;} .embeddedOutputsMatrixElement .matrixElement .valueContainer .horizontalEllipsis.hide,.embeddedOutputsMatrixElement .matrixElement .verticalEllipsis.hide,.eoOutputWrapper .matrixElement .valueContainer .horizontalEllipsis.hide,.eoOutputWrapper .matrixElement .verticalEllipsis.hide,.rtcDataTipElement .matrixElement .valueContainer .horizontalEllipsis.hide,.rtcDataTipElement .matrixElement .verticalEllipsis.hide {    display: none;} .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer.hideEllipses .verticalEllipsis, .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer.hideEllipses .horizontalEllipsis {    display:none;} .embeddedOutputsMatrixElement .matrixElement .valueContainer .horizontalEllipsis,.eoOutputWrapper .matrixElement .valueContainer .horizontalEllipsis {    margin-bottom: -3px;} .eoOutputWrapper .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer {    cursor: default !important;} .embeddedOutputsVariableElement {    white-space: pre-wrap;    word-wrap: break-word;    min-height: 18px;    max-height: 250px;    overflow: auto;} .variableElement {} .embeddedOutputsVariableElement.inlineElement {} .inlineElement .variableElement {} .embeddedOutputsVariableElement.rightPaneElement {    min-height: 16px;} .rightPaneElement .variableElement {    padding-top: 2px;    padding-left: 9px;} .outputsOnRight .embeddedOutputsVariableElement.rightPaneElement .eoOutputContent {    \/* Remove extra space allocated for navigation border *\/    margin-top: 0;    margin-bottom: 0;} .variableNameElement {    margin-bottom: 3px;    display: inline-block;} \/* * Ellipses as base64 for HTML export. *\/.matrixElement .horizontalEllipsis,.rtcDataTipElement .matrixElement .horizontalEllipsis {    display: inline-block;    margin-top: 3px;    \/* base64 encoded version of images-liveeditor\/HEllipsis.png *\/    width: 30px;    height: 12px;    background-repeat: no-repeat;    background-image: url(\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAJCAYAAADO1CeCAAAAJUlEQVR42mP4\/\/8\/A70xw0i29BUDFPxnAEtTW37wWDqakIa4pQDvOOG89lHX2gAAAABJRU5ErkJggg==\");} .matrixElement .verticalEllipsis,.textElement .verticalEllipsis,.rtcDataTipElement .matrixElement .verticalEllipsis,.rtcDataTipElement .textElement .verticalEllipsis {    margin-left: 35px;    \/* base64 encoded version of images-liveeditor\/VEllipsis.png *\/    width: 12px;    height: 30px;    background-repeat: no-repeat;    background-image: url(\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAZCAYAAAAIcL+IAAAALklEQVR42mP4\/\/8\/AzGYgWyFMECMwv8QddRS+P\/\/KyimlmcGUOFoOI6GI\/UVAgDnd8Dd4+NCwgAAAABJRU5ErkJggg==\");}'; var head = document.head || document.getElementsByTagName('head')[0], style = document.createElement('style'); head.appendChild(style); style.type = 'text\/css'; if (style.styleSheet){ style.styleSheet.cssText = css; } else { style.appendChild(document.createTextNode(css)); }<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/community\/files\/spelling_bee_1.png\" onError=\"this.style.display ='none';\" \/><\/div>\n<p>\nEarlier this year I wrote about solving word ladders with MATLAB. There was a lot of interest in that post, so I thought I'd share my investigations regarding another word-based app. In this script,... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/community\/2023\/04\/06\/an-algorithmic-spelling-bee\/\">read more >><\/a><\/p>\n","protected":false},"author":69,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/9129"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/users\/69"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/comments?post=9129"}],"version-history":[{"count":5,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/9129\/revisions"}],"predecessor-version":[{"id":9165,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/9129\/revisions\/9165"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/media?parent=9129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/categories?post=9129"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/tags?post=9129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}