Two Plus Two Poker Forums Pseudo-Turing Machine Problems/Puzzles
 Register FAQ Search Today's Posts Mark Forums Read TwoPlusTwo.com

 Notices The Theory of Poker Applied to No-Limit now available For those of you here in Las Vegas, The Theory of Poker Applied to No-Limit by David Sklansky is now available at Gambler’s General Store/ GAMBLER'S BOOK CLUB in downtown Las Vegas. Their address is 727 S Main St, Las Vegas, NV 89101 and their phone number is (702) 382-9903. We also have this title available in several special poker book promotions directly from Two Plus Two Publishing. For more info or to ask questions check out this thread in the books and publications forum: Sklansky Invites Reviews, Comments, And Questions, About Theory of Poker Applied To No Limit .

 11-14-2018, 03:26 AM #1 Aaron W. Carpal \'Tunnel   Join Date: Sep 2002 Posts: 29,456 Pseudo-Turing Machine Problems/Puzzles I've been kicking around an idea in my head for some programming challenges for introductory programming, and I think I need to hear input from other voices. From my past experiences, students at that level are simply quite sloppy in their thinking, and they just don't have a lot of mental organization. I'm trying to figure out how to fix that. As I was thinking about this, I remembered a type of puzzle that was introduced to me a long time ago. It's basically a simplified model of a Turing machine. You have a finite strip of paper with special markings at the beginning and end to let you know that you've reached the ends. And you have a read/write head that just moves back and forth across that strip. We're going to sweep the state table (the formal language/construct) under the rug and just proceed with a simple flowchart/pseudocode to explain what we're going to do. You can write any code you want, but you only have the following commands: * Read/Write: Reads the value or writes a specific value in the position of the head. My memory was that you could only have the symbols 0 or 1, but that's not absolutely necessary. * Left/Right: Moves the head left or right. If you attempt to move left when you're at the first position there's a feedback that lets you know you're at the beginning. And similarly on the end of the right side. I don't remember being given any memory to work with, but that can be flexible. And my recollection about this starts to run dry pretty quickly after that. I remember there being little puzzles. They all started with a random collection of 0s and 1s. For example: * Move all the 1s to the left or right. * Create alternating 0s and 1s (or determine this is not possible). And... that's it. The basic idea is that anyone can look at that and say "That's easy" but when you actually get them to explain how they would do it step-by-step (ie, using the four commands), they reach that level of cognitive dissonance where they *know* they can do it, but have a hard time explaining exactly what they're doing. And that's what forces them to really slow down and pick things apart more carefully. So here are my questions: 1) Does anyone have any recollection of something like this? Maybe it was in a magazine or something? I don't think it was from a book or a textbook. There may even be lots of implementations of this idea floating around, and I just haven't looked in the right places. 2) Do you think that these puzzles could be beneficial to students? Or do you think it's "too much" or "too difficult" or "not in the right direction" to try to do this early on? 3) Can you think of any other programming puzzles that would make use this structure? As far as implementing their plan, I have a pretty basic Python module that I think should do it. Code: ```class Turing: def __init__(self, length): self.tape = [0] * length self.position = 0 def randomize(self): from random import randrange for position in range(len(self.tape)): self.tape[position] = randrange(2) self.display() return True def display(self): for symbol in self.tape: print(symbol, ' ', end='') print() for _ in range(self.position): print(' ', end='') print('^') def move_right(self): self.position += 1 if(self.position) == len(self.tape): self.position -= 1 print('End of Tape') self.display() return False self.display() return True def move_left(self): self.position -= 1 if(self.position) == -1: self.position = 0 print('End of Tape') self.display() return False self.display() return True def read(self): return self.tape[self.position] def write(self, value): if type(value) != type(0): print('You can only write integers') return False self.tape[self.position] = value return True```
 11-14-2018, 04:18 AM #2 leavesofliberty Carpal \'Tunnel   Join Date: Jul 2010 Location: probably busto Posts: 6,280 Re: Pseudo-Turing Machine Problems/Puzzles Have not tried this, but ProLog might be what you seek. https://en.wikipedia.org/wiki/Logic_programming
11-14-2018, 08:22 AM   #3
jukofyork
Carpal \'Tunnel

Join Date: Sep 2004
Posts: 11,365
Re: Pseudo-Turing Machine Problems/Puzzles

Quote:
 Originally Posted by Aaron W. 1) Does anyone have any recollection of something like this? Maybe it was in a magazine or something? I don't think it was from a book or a textbook. There may even be lots of implementations of this idea floating around, and I just haven't looked in the right places.
Possibly it's the Scientific American articles from the 70's and 80's by Martin Gardner (and later by Alexander Dewdney), eg:

https://www.jstor.org/stable/2496942...n_tab_contents

Juk

11-15-2018, 12:45 AM   #4
Aaron W.
Carpal \'Tunnel

Join Date: Sep 2002
Posts: 29,456
Re: Pseudo-Turing Machine Problems/Puzzles

Quote:
 Originally Posted by jukofyork Possibly it's the Scientific American articles from the 70's and 80's by Martin Gardner (and later by Alexander Dewdney), eg: https://www.jstor.org/stable/2496942...n_tab_contents Juk
Heh... it might well have been those. Thanks!

11-15-2018, 04:05 AM   #5
jmakin

Join Date: Jan 2008
Location: Streaming
Posts: 28,627
Re: Pseudo-Turing Machine Problems/Puzzles

Quote:
 Originally Posted by leavesofliberty Have not tried this, but ProLog might be what you seek. https://en.wikipedia.org/wiki/Logic_programming
i wouldnt wish to inflict prolog on anyone :/

 11-15-2018, 04:39 PM #6 river_tilt old hand     Join Date: Apr 2006 Location: Swimming with sharks Posts: 1,297 Re: Pseudo-Turing Machine Problems/Puzzles I thought the busy beaver numbers had a state table. The n-th number is based on a n-state machine. Chaitin's number is also quite an interesting idea in this area.
11-15-2018, 11:12 PM   #7
codeartisan
centurion

Join Date: Jun 2008
Posts: 155
Re: Pseudo-Turing Machine Problems/Puzzles

Quote:
 Originally Posted by jmakin i wouldnt wish to inflict prolog on anyone :/
How many Prolog programmers does it take to change a lightbulb?
Yes.

11-16-2018, 08:20 AM   #8
jukofyork
Carpal \'Tunnel

Join Date: Sep 2004
Posts: 11,365
Re: Pseudo-Turing Machine Problems/Puzzles

Quote:
 Originally Posted by codeartisan How many Prolog programmers does it take to change a lightbulb? Yes.

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Links to Popular Forums     News, Views, and Gossip     Beginners Questions     Marketplace & Staking     Casino & Cardroom Poker     Internet Poker     NL Strategy Forums     Poker Goals & Challenges     Las Vegas Lifestyle     Sporting Events     Other Other Topics Two Plus Two     About the Forums     Two Plus Two Magazine Forum     The Best of Two Plus Two Marketplace & Staking     Commercial Marketplace     General Marketplace     Staking - Offering Stakes     Staking         Staking - Offering Stakes         Staking - Seeking Stakes         Staking - Selling Shares - Online         Staking - Selling Shares - Live         Staking Rails         Transaction Feedback & Disputes     Transaction Feedback & Disputes Coaching & Training     Coaching Advice     Cash Game Poker Coach Listings     Tournament/SNG Poker Coach Listings Poker News & Discussion     News, Views, and Gossip     Poker Goals & Challenges     Poker Beats, Brags, and Variance     That's What She Said!     Poker Legislation & PPA Discussion hosted by Rich Muny     Twitch - Watch and Discuss Live Online Poker     Televised Poker General Poker Strategy     Beginners Questions     Books and Publications     Poker Tells/Behavior, hosted by: Zachary Elwood     Poker Theory     Psychology No Limit Hold'em Strategy     Medium-High Stakes PL/NL     Micro-Small Stakes PL/NL     Medium-High Stakes Full Ring     Micro-Small Stakes Full Ring     Heads Up NL     Live Low-stakes NL Limit Texas Hold'em Strategy     Mid-High Stakes Limit     Micro-Small Stakes Limit Tournament Poker Strategy     STT Strategy     Heads Up SNG and Spin and Gos     Mid-High Stakes MTT     Small Stakes MTT     MTT Community     Tournament Events Other Poker Strategy     High Stakes PL Omaha     Small Stakes PL Omaha     Omaha/8     Stud     Draw and Other Poker Live Poker     Casino & Cardroom Poker         Venues & Communities         Regional Communities     Venues & Communities     Tournament Events         WPT.com     Home Poker     Cash Strategy     Tournament Strategy Internet Poker     Internet Poker         Global Poker         MPN – Microgaming Poker Network         BetOnline.ag Online Poker     Commercial Software     Software         Commercial Software         Free Software General Gambling     Backgammon Forum hosted by Bill Robertie.     Probability     Sports Betting     Other Gambling Games 2+2 Communities     Other Other Topics         OOTV         Game of Thrones     The Lounge: Discussion+Review     EDF     Las Vegas Lifestyle     BBV4Life         omg omg omg     House of Blogs Sports and Games     Sporting Events         Single-Team Season Threads         Fantasy Sports     Fantasy Sports         Sporting Events     Wrestling     Golf     Chess and Other Board Games     Video Games         League of Legends         Hearthstone     Puzzles and Other Games Other Topics     Politics and Society     History     Business, Finance, and Investing     Science, Math, and Philosophy     Religion, God, and Theology     Travel     Health and Fitness     Laughs or Links!     Computer Technical Help     Programming

All times are GMT -4. The time now is 08:27 AM.

 Contact Us - Two Plus Two Publishing LLC - Privacy Statement - Top