## How to generate Deterministic finite automaton for given language

Problem: Write a program which generates Deterministic finite automaton which accepts given language. Language is defined with alphabet and start/end sub strings.

For example: Alphabet={a,b,c}; start sub string=”ab”; end sub string=”cb”

I need to construct DFA which will accept strings of kind: {abcb, abaacb, abcabcb…}.

Question: What algorithm should I use to write function which will construct DFAs for this set of problems.

## Given a DFA M, formally define an NFA N such that L(N) = {x in L(M) | x = reverse(x)}

The english description of the question is (from my understanding) N accepts all strings that are both palindromic (the same forwards as it is backwards) and accepted by M. After a lot of toil and trouble, I’m not convinced that such a definition of N is even possible. My thinking is as follows:

Say M above is the DFA that accepts the language $$(1 + 0)^*$$. Then the desired N would describe all palindromes over the language $$\{1, 0\}$$. However, such a language is not regular (I think). Therefore, is it not the case that such a formal definition is not possible, as NFAs can only describe regular languages?

Perhaps I am missing some subtle nuance in the question, but I believe that such a formal definition is simply not possible. Is my thinking correct?

## I was given a XML web part that uses SharePoint Services. I need to convert it into an ajax/JSON webpart

I was given an old webpart using SP services and XML. I was requested to use Ajax. This is the first time I do this kind of conversion and I am not sure if I am doing it correctly.

<?xml version="1.0" encoding="utf-8"?> <WebPart xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/WebPart/v2">   <Title>LeftNav MultiTopic Accordion Webpart</Title>   <FrameType>None</FrameType>   <Description>TLeftNav MultiTopic Accordion Webpart</Description>   <IsIncluded>true</IsIncluded>   <ZoneID>wpz</ZoneID>   <PartOrder>0</PartOrder>   <FrameState>Normal</FrameState>   <Height />   <Width />   <AllowRemove>true</AllowRemove>   <AllowZoneChange>true</AllowZoneChange>   <AllowMinimize>true</AllowMinimize>   <AllowConnect>true</AllowConnect>   <AllowEdit>true</AllowEdit>   <AllowHide>true</AllowHide>   <IsVisible>true</IsVisible>   <DetailLink />   <HelpLink />   <HelpMode>Modeless</HelpMode>   <Dir>Default</Dir>   <PartImageSmall />   <MissingAssembly>Cannot import this Web Part.</MissingAssembly>   <PartImageLarge>/_layouts/images/mssfwp.gif</PartImageLarge>   <IsIncludedFilter />   <Assembly>Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>   <TypeName>Microsoft.SharePoint.WebPartPages.SimpleFormWebPart</TypeName>   <Content xmlns="http://schemas.microsoft.com/WebPart/v2/SimpleForm"><![CDATA[<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml" xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"> <head> <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.16/css/dataTables.bootstrap4.min.css"/>     <script type="text/javascript" src="/Style%20Library/V6/js/vendor/mdb/jquery-3.2.1.min.js"></script> <style type="text/css">         #topicNav select{             display: none!important;         }          @media (max-width: 767px) {             #topicNav{                 text-align:center;             }             #topicNav ul {                 display: none;             }             #topicNav select {                 display: inline-block!important;             }         }          #accordionEx .accordion .card{     border-bottom: 1px #81D4FA solid !important; } #accordionColumn span{     ;     float:right;     margin-bottom:2.5rem;  } #accordionColumn span:after{     content: "\f067";     font-family: FontAwesome;     ;     right: 0;     top: 0;     left:100%;     color:black;     display: block;     width: 32px;     height: 32px;     line-height: 32px;     background:#4FC3F7;     border-radius:50%;     vertical-align: middle;     text-align: center;     -webkit-transition: all .35s;     -o-transition: all .35s;     transition: all .35s; }  #accordionColumn span.down:after {     -ms-transform: rotate(135deg);     -moz-transform: rotate(135deg);     -webkit-transform: rotate(135deg);     transform: rotate(135deg);  }     </style> </head> <body> <form id="form1" runat="server">     <section aria-label="Main Page Content" id="td">         <div class="container py-3">         <div class="row justify-content-center justify-content-md-end my-2">                 <div class="col-md-4 col-10 pr-1">                     <div class="z-depth-1 bg-white pr-3" style="border-radius:4px;">                         <input class="form-control pl-3" id="tdSearch" style="border-radius:4px;" type="text" placeholder="Search" aria-label="Search" data-search/>                     </div>                 </div>                 <div class="col-md-1 col-2 d-flex px-0 justify-content-md-end justify-content-start">                     <button class="btn btn-sm px-4 d-flex justify-content-center" style="background-color:#039BE5; margin-top:4px; margin-bottom:16px" type="button" data-search-button><i class="fal fa-search" style="font-size:24px"></i></button>                 </div>             </div>             <div class="row justify-content-between">                 <div class="col-md-3 col-12 pr-md-4">                     <h4 class="pb-md-3 font-weight-bold text-center text-md-left">CATEGORY</h4>                     <div id="topicNav" class="pb-md-3 py-md-0">                         <ul class="px-0" id="topicOptions" style="list-style-type:none; border-left:solid medium #eaeaea;">                             <!--Options injected here-->                         </ul>                     </div>                 </div>                 <div class="col-md-9 col-12 pt-3 pt-md-0 px-3 px-md-0">                     <h2 id="tdTopicTitle" class="pb-3 font-weight-bold text-center text-md-left text-uppercase">Airlines</h2>                 <!-- Grid row -->                     <div class="row d-flex justify-content-center">                          <!-- Grid column -->                         <div class="col-md-12 pb-5 mr-1" id="accordionColumn">                          </div>                         <!-- Grid column -->                      </div>                     <!-- Grid row -->                 </div>             </div>             </div>     </section>   </form> <script type="text/javascript" src="/Style%20Library/V6/js/vendor/mdb/jquery-3.2.1.min.js"></script> <script type="text/javascript"> //Webpart Scripts  var accID = 'AIRLINES'; var searchVal = ''; $(document).ready(function () { tdResults =$  ().SPServices.SPGetListItemsJson({         webURL: "/airport/business",         listName: "TenantDirectory",         viewName: "",         CAMLQuery: "",         CAMLViewFields: "",         CAMLRowLimit: "",         CAMLQueryOptions: "",         changeToken: "",         contains: "",         mapping: {             ows_Title: {                 mappedName: "Title",                 objectType: "Text"             },             ows_Address: {                 mappedName: "Address",                 objectType: "Text"             },             ows_Numbers: {                 mappedName: "Numbers",                 objectType: "Text"             },             ows_Categories: {                 mappedName: "Categories",                 objectType: "Text"             },             ows_link: {                 mappedName: "Link",                 objectType: "Text"             },             ows_ID: {                 mappedName: "ID",                 objectType: "Text"             },          },         mappingOverrides: null,         debug: false     });      $.when(tdResults).done(function () { var thistdResults = this.data; function onlyUnique(value, index, self) { return self.indexOf(value) === index; } var tdItems =$  .each(thistdResults, function (ind, tdItems) {             return tdItems;         });          var allTopics = [];         for (i = 0; i < tdItems.length; i++) {             var filterTopics = tdItems[i];             allTopics.push(filterTopics.Categories);         };         allTopics.sort();          var topicList = allTopics.filter(onlyUnique);         for (i = 0; i < topicList.length; i++) {             var topicName = topicList[i]             $('#topicOptions').append('<li class="py-1 pl-3"><a href="#" class="text-dark">' + topicName + '</a></li>'); } var effectIn = function () {$  ('#tdTopicTitle').html(accID).fadeTo(500, 1);             return $("#accordionColumn").fadeTo(500, 1); }; var effectOut = function () {$  ('#tdTopicTitle').fadeTo(500, 0);             return $("#accordionColumn").fadeTo(500, 0); }; //includes Polyfill if (!String.prototype.includes) { Object.defineProperty(String.prototype, 'includes', { value: function(search, start) { if (typeof start !== 'number') { start = 0 } if (start + search.length > this.length) { return false } else { return this.indexOf(search, start) !== -1 } } }) } function createAccordion() { var tdItems =$  .each(thistdResults, function (ind, tdItems) {                 return tdItems;             });             if (accID != 'Search Results'){                 var filterTopic = tdItems.filter(function (e) {                     return e.Categories.toUpperCase() == accID;                 });             }else{                 var filterTopic = tdItems.filter(function (e) {                     var questions = e.Title.toLowerCase();                     return questions.includes(searchVal);                 });             }             var buildAcc = function () {                 var accID2 = accID.replace(/\s/g, '');                 var accBuild = '<div class="accordion" id="' + accID2 + '" role="tablist" aria-multiselectable="true""></div>'                 $("#accordionColumn").append(accBuild); }; buildAcc(); var buildCards = function () { if(filterTopic.length !== 0){ for (i = 0; i < filterTopic.length; i++) { var accID2 = accID.replace(/\s/g, ''); var tdItems = filterTopic[i]; var headerID = "heading" + tdItems.ID; var cardBodyID = "collapse" + tdItems.ID; var cardTitle = tdItems.Title; if (tdItems.Address){ var cardAdd = '<p><strong>Address:</strong> ' + tdItems.Address + '</p>' }else{ var cardAdd = '' } if(tdItems.Numbers){ var cardNumbers = '<p><strong>Numbers:</strong><br/> ' + tdItems.Numbers + '</p>' }else{ var cardNumbers = '' } if (tdItems.Link){ var cardWebsite = tdItems.Link.slice(0, -1); var website = '<p><strong>Website:</strong> <a href="'+ cardWebsite +'" target="_blank">'+ cardWebsite +'</a></p>' }else{ var website = '' } var cardBuild = '<div class="card">' + '<div class="card-header pb-1 pl-0" role="tab" id="' + headerID + '">' + '<a class="collapsed" data-toggle="collapse" data-parent="#' + accID2 + '" href="#' + cardBodyID + '" aria-expanded="false" aria-controls="' + cardBodyID + '">' + '<h5 class="mb-0 font-thin">' + cardTitle + '<span class="rotate"></span></h5>' + '</a>' + '</div>' + '<div id="' + cardBodyID + '" class="collapse" role="tabpanel" aria-labelledby="' + headerID + '" data-parent="#' + accID + '">' + '<div class="card-body py-1 pl-0">' + cardAdd + cardNumbers + website + '</div>'+ '</div>' + '</div>'$  (".accordion").append(cardBuild);                     };                     }else{                         var cardBuild = '<h4>There are no results matching your search.</div>'                         $(".accordion").append(cardBuild); } //Accordion Icon Animation$  ('.accordion > div > div > a').on('click', function () {                         $(this).find(".rotate").addClass("down"); });$  ('.accordion > div > div > a').on('click', function () {                         $(this).find(".rotate").addClass("down"); }); }; buildCards(); }; createAccordion();$  ("#topicOptions > li:first-child > a").parent().css({             borderLeft: "solid medium #039BE5",             marginLeft: "-3px"         });          $("#topicOptions > li > a").on("click", function () { event.returnValue = false; accID = this.innerHTML.toUpperCase();$  ("[data-search]")[0].value = '';             $("#topicOptions > li").css({ borderLeft: "none", marginLeft: "0px" });$  (this).parent().css({                 borderLeft: "solid medium #039BE5",                 marginLeft: "-3px"             });             $.when(effectOut()).done(function () {$  (".accordion").remove();                 createAccordion();                 effectIn();             });         });          function topicNav() {             // Create the dropdown base             $("<select style=\"border:none; height:50px;\" class=\"browser-default custom-select w-100 z-depth-1\" />").appendTo("#topicNav"); // Create default option "Go to..."$  ("<option />", {                 "selected": "",                 "value": "Choose a Topic",                 "text": "Choose a Topic"             }).appendTo("#topicNav select");              // Populate dropdown with menu items             $("#topicNav > ul > li > a").each(function () { var topicsSelect =$  (this);                 $("<option />", { "value": topicsSelect.text(), "text": topicsSelect.text() }).appendTo("#topicNav select"); }); // To make dropdown actually work // To make more unobtrusive: https://css-tricks.com/4064-unobtrusive-page-changer/$  ("#topicNav select").change(function () {                 accID = $(this).find("option:selected").val()$  .when(effectOut()).done(function () {                     $(".accordion").remove(); createAccordion(); effectIn(); }); }); }; topicNav(); //Search Function$  ('[data-search]').keypress(function(event) {             if (event.which == 13){             event.preventDefault();             event.returnValue = false;             accID = 'Search Results';              searchVal = $(this).val().toLowerCase();$  .when(effectOut()).done(function () {                     $("#topicOptions > li").css({ borderLeft: "none", marginLeft: "0px" });$  (".accordion").remove();                     createAccordion();                     effectIn();                 });             }         });         $('[data-search-button]').on('click', function(event) { event.preventDefault(); event.returnValue = false; accID = 'Search Results';$  ("#topicOptions > li").css({                 borderLeft: "none",                 marginLeft: "0px"             });              searchVal = $('#tdSearch').val().toLowerCase();$  .when(effectOut()).done(function () {                     $("#topicOptions > li").css({ borderLeft: "none", marginLeft: "0px" });$  (".accordion").remove();                     createAccordion();                     effectIn();                 });         });     }); });     webpartMove = $("#td") webpartMove.detach(); webpartMove.appendTo("#fullPageContent");$  ("#fullPageContent > div > div.row.pt-3.mb-r").removeClass('mb-r pt-3');  </script> </body> </html>]]></Content> </WebPart> 

This is what I have done so far.

var accID = 'AIRLINES'; var searchVal = '';  var tdResults = $.ajax({ url: apiUrl1, method: 'GET', headers: { 'Accept': 'application/json; odata=verbose' }, success: function (data) { var items = data.d.results; for (var i = 0; i < items.length; i++) { var title = items[i].Title; var address = items[i].Address; var number = items[i].Numbers; var categories = items[i].Categories; var id = items[i].ID; var link = items[i].Link; } // this ends for loop /*mappingOverrides: null, debug: false*/ }, // this ends success function error: function(data) { console.log('Error: ' + data); } }); //end of ajax$  .when(tdResults).done(function () {         var thistdResults = this.data;         function onlyUnique(value, index, self) {             return self.indexOf(value) === index;         }         var tdItems = $.each(thistdResults, function (ind, tdItems) { return tdItems; }); var allTopics = []; for (i = 0; i < tdItems.length; i++) { var filterTopics = tdItems[i]; allTopics.push(filterTopics.Categories); }; allTopics.sort(); var topicList = allTopics.filter(onlyUnique); for (i = 0; i < topicList.length; i++) { var topicName = topicList[i]$  ('#topicOptions').append('<li class="py-1 pl-3"><a href="#" class="text-dark">' + topicName + '</a></li>');         }         var effectIn = function () {             $('#tdTopicTitle').html(accID).fadeTo(500, 1); return$  ("#accordionColumn").fadeTo(500, 1);         };          var effectOut = function () {             $('#tdTopicTitle').fadeTo(500, 0); return$  ("#accordionColumn").fadeTo(500, 0);         };         //includes Polyfill         if (!String.prototype.includes) {           Object.defineProperty(String.prototype, 'includes', {             value: function(search, start) {               if (typeof start !== 'number') {                 start = 0               }                if (start + search.length > this.length) {                 return false               } else {                 return this.indexOf(search, start) !== -1               }             }           })         }         function createAccordion() {             var tdItems = $.each(thistdResults, function (ind, tdItems) { return tdItems; }); if (accID != 'Search Results'){ var filterTopic = tdItems.filter(function (e) { return e.Categories.toUpperCase() == accID; }); }else{ var filterTopic = tdItems.filter(function (e) { var questions = e.Title.toLowerCase(); return questions.includes(searchVal); }); } var buildAcc = function () { var accID2 = accID.replace(/\s/g, ''); var accBuild = '<div class="accordion" id="' + accID2 + '" role="tablist" aria-multiselectable="true""></div>'$  ("#accordionColumn").append(accBuild);             };             buildAcc();             var buildCards = function () {                 if(filterTopic.length !== 0){                     for (i = 0; i < filterTopic.length; i++) {                         var accID2 = accID.replace(/\s/g, '');                         var tdItems = filterTopic[i];                         var headerID = "heading" + tdItems.ID;                         var cardBodyID = "collapse" + tdItems.ID;                         var cardTitle = tdItems.Title;                         if (tdItems.Address){                             var cardAdd = '<p><strong>Address:</strong> ' + tdItems.Address + '</p>'                         }else{                             var cardAdd = ''                         }                         if(tdItems.Numbers){                             var cardNumbers = '<p><strong>Numbers:</strong><br/> ' + tdItems.Numbers + '</p>'                                            }else{                             var cardNumbers = ''                         }                         if (tdItems.Link){                             var cardWebsite = tdItems.Link.slice(0, -1);                             var website = '<p><strong>Website:</strong> <a href="'+ cardWebsite +'" target="_blank">'+ cardWebsite +'</a></p>'                          }else{                             var website = ''                         }                            var cardBuild = '<div class="card">' +                             '<div class="card-header pb-1 pl-0" role="tab" id="' + headerID + '">' +                             '<a class="collapsed" data-toggle="collapse" data-parent="#' + accID2 + '" href="#' + cardBodyID + '" aria-expanded="false" aria-controls="' + cardBodyID + '">' +                             '<h5 class="mb-0 font-thin">' + cardTitle + '<span class="rotate"></span></h5>' +                             '</a>' +                             '</div>' +                             '<div id="' + cardBodyID + '" class="collapse" role="tabpanel" aria-labelledby="' + headerID + '" data-parent="#' + accID + '">' +                              '<div class="card-body py-1 pl-0">' + cardAdd + cardNumbers + website + '</div>'+                             '</div>' +                             '</div>'                         $(".accordion").append(cardBuild); }; }else{ var cardBuild = '<h4>There are no results matching your search.</div>'$  (".accordion").append(cardBuild);                     }                         //Accordion Icon Animation                     $('.accordion > div > div > a').on('click', function () {$  (this).find(".rotate").addClass("down");                     });                     $('.accordion > div > div > a').on('click', function () {$  (this).find(".rotate").addClass("down");                     });                 };             buildCards();          };         createAccordion();         $("#topicOptions > li:first-child > a").parent().css({ borderLeft: "solid medium #039BE5", marginLeft: "-3px" });$  ("#topicOptions > li > a").on("click", function () {             event.returnValue = false;             accID = this.innerHTML.toUpperCase();             $("[data-search]")[0].value = '';$  ("#topicOptions > li").css({                 borderLeft: "none",                 marginLeft: "0px"             });             $(this).parent().css({ borderLeft: "solid medium #039BE5", marginLeft: "-3px" });$  .when(effectOut()).done(function () {                 $(".accordion").remove(); createAccordion(); effectIn(); }); }); function topicNav() { // Create the dropdown base$  ("<select style=\"border:none; height:50px;\" class=\"browser-default custom-select w-100 z-depth-1\" />").appendTo("#topicNav");             // Create default option "Go to..."             $("<option />", { "selected": "", "value": "Choose a Topic", "text": "Choose a Topic" }).appendTo("#topicNav select"); // Populate dropdown with menu items$  ("#topicNav > ul > li > a").each(function () {                 var topicsSelect = $(this);$  ("<option />", {                     "value": topicsSelect.text(),                     "text": topicsSelect.text()                 }).appendTo("#topicNav select");             });              // To make dropdown actually work             // To make more unobtrusive: https://css-tricks.com/4064-unobtrusive-page-changer/             $("#topicNav select").change(function () { accID =$  (this).find("option:selected").val()                 $.when(effectOut()).done(function () {$  (".accordion").remove();                     createAccordion();                     effectIn();                 });             });           };         topicNav();          //Search Function         $('[data-search]').keypress(function(event) { if (event.which == 13){ event.preventDefault(); event.returnValue = false; accID = 'Search Results'; searchVal =$  (this).val().toLowerCase();                 $.when(effectOut()).done(function () {$  ("#topicOptions > li").css({                         borderLeft: "none",                         marginLeft: "0px"                     });                      $(".accordion").remove(); createAccordion(); effectIn(); }); } });$  ('[data-search-button]').on('click', function(event) {             event.preventDefault();             event.returnValue = false;             accID = 'Search Results';              $("#topicOptions > li").css({ borderLeft: "none", marginLeft: "0px" }); searchVal =$  ('#tdSearch').val().toLowerCase();                 $.when(effectOut()).done(function () {$  ("#topicOptions > li").css({                         borderLeft: "none",                         marginLeft: "0px"                     });                      $(".accordion").remove(); createAccordion(); effectIn(); }); }); }); webpartMove =$  ("#td")     webpartMove.detach();     webpartMove.appendTo("#fullPageContent");     \$  ("#fullPageContent > div > div.row.pt-3.mb-r").removeClass('mb-r pt-3');  </script> 

## Mystic UA: are Exacting Query responses given vocally or telepathically?

The 2017 UA Mystic has various Psionic Disciplines. Under Telepathic Contact is an option called Exacting Query, whose description states:

Exacting Query (2 psi). As an action, you target one creature you can communicate with via telepathy. The target must make an Intelligence saving throw. On a failed save, the target truthfully answers one question you ask it via telepathy. On a successful save, the target is unaffected, and you can’t use this ability on it again until you finish a long rest. A creature is immune to this ability if it is immune to being charmed.

This question is asked via telepathy, but is it answered via telepathy or vocally? The Mystic’s telepathy (gained at level 2) seems to be described as only operating one way (from the Mystic to any creature the Mystic can see within 120 feet). So does this imply that the answer to an Exacting Query would be vocal?

## How to schedule events optimally given when the events are available?

Suppose I had a dictionary that contains events and the corresponding periods they are occurring. For example:

\begin{align} \textrm{Event 1} &\rightarrow \textrm{[1, 2, 3]} \ \textrm{Event 2} &\rightarrow \textrm{[2, 4]} \ \textrm{Event 3} &\rightarrow \textrm{[4]} \ \textrm{Event 4} &\rightarrow \textrm{[2, 3]} \end{align}

How would I go about generating a schedule so that the events are scheduled optimally? For the example above, one possible optimal schedule would be:

\begin{align} \textrm{Period 1} &\rightarrow \textrm{Event 1} \ \textrm{Period 2} &\rightarrow \textrm{Event 2} \ \textrm{Period 3} &\rightarrow \textrm{Event 4} \ \textrm{Period 4} &\rightarrow \textrm{Event 3} \ \end{align}

Is there any way to do this in better than checking every permutation? This seems like the reverse of the graph-coloring problem for scheduling, so is there any way to construct a graph to encapsulate this relationship and maybe find a shortest path? Can someone point me in the right direction on how to approach this?

## Given one sending stone, how can I locate its mate?

Suppose I have one of a pair of sending stones, and I wish to locate the other stone of the pair. Is there any spell or other magic that will allow me to find the stone’s mate? Assume I have never held or seen the stone’s mate.

A limited range solution is potentially acceptable, but longer range or unlimited range solution is preferred (even more so if it works across planes), since I have no way of knowing where the other stone is. However, any solution must locate the specific stone, not just any sending stone (not least because unless I have a bag of holding, the nearest sending stone is always going to be the one in my pocket). If there are any additional limitations to the solution, be sure to note them (e.g. “the stone must not be in the possession of a creature”, “the stone must not be inside a lead box”, etc.). Lastly, casting Wish and wishing to know the stone’s location should obviously work, so there’s no need to mention this option (also, casting Wish in this way carries the very severe limitations of needing a 9th level spell and risking losing access to Wish, so I wouldn’t consider it a great solution). In short: the best solution would have the longest possible range and the fewest possible limitations.

## Whether the given language is a CFL or not?

Let $$L$$ be a language defined over $$\Sigma = \left \{ a, b \right \}$$ such that $$L = \left \{ x\#y \mid x,y \in \Sigma^*, \# \text { is a constant and } x \neq y \right \}$$ State whether the language L is a CFL or not? Give valid reasons for the same.

Now, I think that the given language is not a CFL. I have used the pumping lemma test for showing that L is not CFL. Specifically, I have done the following-

Consider a string $$w = abb\#aab$$. Obviously, $$w \in L$$.

Let, $$u = \epsilon \ v = a \ w = bb\#aa \ x = b \ y = \epsilon$$

Here, $$|vx| \geq 1$$

But, $$uv^2wx^2y = aabb\#aabb \notin L$$ Therefore, pumping lemma test result is negative. Therefore, we can conclude that the given language is not a CFL.

Now, I have a doubt regarding the above method- I know that given a CFL, if we want to perform the pumping lemma test for the CFL, we must always use strings which are of length greater than or equal to the minimum pumping length. In fact, this also confirms to the condition that the length of the string $$w$$ used for the pumping lemma test (denoted by $$|w|$$) must be greater than or equal to n.

Therefore, when I use $$w = abb\#aab$$ for doing the pumping lemma test, I implicitly make the assumption that 7 is greater than or equal to the minimum pumping length (if $$L$$ were to be a CFL). Am I correct or incorrect in doing so?

## Opening document from Search results – This action couldn’t be performed because Office doesn’t recognize the command it was given

Hi I am trying to open an Office document by clicking on the search results document title, however an error box pops up saying:

This action couldn't be performed because Office doesn't recognize the command it was given.

From the same computer with the above error, it can open in Chrome OK.

If I copy the url of the document and paste it in to a new Window in IE, the document opens OK.

If I right click and open the document in a new tab in IE, again it opens OK.

It is only when left clicking and trying to open the document from the Search results window.

On another computer I get the same error as above in IE, and yet another third computer again it works in IE!

Screenshot of the issue is below:

## Which algorithm for predicting the next word(s) based on previous words, given a sentence?

I want to input some words, and out comes the next word(s). Neural nets are really hot at the moment, and I’m afraid of throwing a neural net at something, when one is not really needed. Or… maybe it is needed?

My current options are:

• Predict next word(s) using N-grams
• Predict next word(s) using a neural net

There are quite a number of Github repositories that does this using neural nets, and a few that does it with N-grams. Are there any clear advantages to choosing the neural net approach?

## Constant vs linear time given knowledge of input distribution

Question about computer science whether a problem is O(1) or O(N). This was a thought experiment I came up with and I’m sure it’s rather basic. But I wasn’t sure how to look it up so I apologize if this is already posted on here somewhere. But I was wondering … let’s say we have a simple question: given a string of random integers, is there any number that’s greater than a certain threshold value in the series, if that would be a linear or constant time Big O? Now the small twist is that the distribution of the input would be known for example let’s say we want to look at a series of N numbers to see if one is at least N/2. If yes, boom we are done. And let’s say the numbers are positive integers bounded to N so all n < N. Given we know this distribution does it change if it is O(1) or O(N)? If we have a very long string of numbers then of course it is possible that no number meets the threshold but this becomes a much smaller and smaller and smaller possibility for a long series of such random numbers. Does it make a difference if the N/2 threshold is some constant integer value less than N?