Wednesday, November 26, 2025

Monty Hall Problem and the Problem of Artificial Intelligence

I’m always looking for interesting projects. The other day I ran into the story of the Monty Hall Problem. The brief version of this logic/probability problem is based on a famous game show. In the hypothetical, a player is trying to win a car. Behind two doors are goats with a car behind the third. The player picks one of the doors. Before opening the door the show host opens a door, a different door, and shows that there is a goat behind it.

The player is then given a choice – stay with their first guess or switch to the different door. What’s the best option? The answer from Marilyn vos Savant who has the highest recorded IQ was that the player should change their guess.

This answer was highly controversial with many experts in probability and math saying she was wrong. Computer simulations showed that she was right though. There is an explanation for this in the Wikipedia article linked to at the top of this post.

If you know me at all, you can probably guess that I had to write a simulation myself. Trust but verify! I think it makes a good project to assign students as well.

There is a little fly in the ointment for me though. I crated a project with the name “Monty Hall” and with almost no other hint than that and Copilot in Visual Studio started writing code for the simulation!  Well, that was a surprise.  I have mixed feelings about the help. It made writing the simulation easier for me but it kind of took some of the fun away from it as well.

Copilot’s code assumed form objects that I had not created as well. It didn’t create those objects automatically. Fortunately for me, I know enough about Visual Studio and Windows Forms that I could add them easily enough. I am also experienced enough that I added other code and objects to make the project more me.

Also, as an experienced programmer, I was able to easily understand the generated code. The code generated is a little different than what I would have generated. Better? Worse? Really, just different. No big deal for an experienced programmer.

What about students? As teachers, we probably don’t want students having AI write 90% of their code for them. Copilot can be turned off and doing so is a very good idea in classroom and school lab situations.

Will students understand the generated code? In many cases, probably not. In this case, the generated code used the the ternary conditional operator. This is a perfectly valid operator in C#, Java, C++, and several other languages. It’s not often taught to beginners however. It also used a break statement which a lot of software purists do not approve of and strongly teach against.

So determining if a student used AI to write their code may, in some cases, be easy to determine. Not something you want to bet on though.

Circling back to the assumptions that Copilot makes – like objects and variables not defined automatically – students may struggle with adding the missing pieces. I would expect that in some cases trying to add what AI leaves out may be more problematic than writing code on ones own. Frustration is a common problem for students already. Artificial Intelligence may, in some cases, exacerbate the problem.

As I have noted in several blog posts, AI often creates solutions different from how I would code them. That has been a learning experience for me. I love seeing different solutions, different language features, or features used differently.

It is potentially a learning experience for students as well. My concern is that without a solid knowledge base will students be able to really understand and learn from AI generated code? Some will. Many will not.

We’re all trying to figure out what artificial intelligence means for software development and especially for teaching software development. It’s going to be a wild ride for a while.

Tuesday, November 18, 2025

CS Education Researchers On Regrets

Pay Yongpradit recently posted (LinkedIn post) about asking a number of computer science education leaders and researchers “about their biggest regret in their respective research areas.” The answers were interesting to say the least. I think they are important as well.

Natalie Rusk -  Research Scientist and OctoStudio Team Lead at MIT Media Lab

That education has focused on Scratch as a tool, where students “learn Scratch” rather than the ideas/mindsets it was designed to develop, and for only a short time (e.g., a 3-week module), rather than as an experience that can be revisited constantly and grow with students.

It does seem like Scratch is often used as a sort of quick introduction to programming. It's big with An Hour of Code and that is fine as far as it goes but Scratch, and similar block based programming tools, can be so much more. It could be incorporated into other subjects, used as way to help students think and explore.

Sue Sentance - Research Professor, University of Cambridge

That the UK didn't fund scaled, organized teacher PD when they rolled out their national computing program in 2014. They had a bottom-up approach with their network of master teachers, but it wasn't enough to train teachers at the scale and quality they needed. Also that the UK hasn't emphasized the importance of CS Ed research when introducing CS in schools, especially for the youngest kids.

Professional Development for computer science educators and for educators who use computer science but don't always see themselves as CS educators is woefully inadequate. A week or three is not enough time. Worse still is that most PD is skill based rather than pedagogic. Most PD is "here is a neat tool and now we are going to teach you how to use it." That's different from "here is how to teach using this tool." It's even more different, and less than, "here is how we use this tool to teach this concept." That later is what teachers really need. We are also not seeing enough research in how to teach computer science. Teachers are often reluctant to incorporate the learning from that research as well. A lot of what is sold as research based has had a short shelf live over the years.

That doesn't encourage teachers as they have seen too many "research based" ideas last a year or two and then be replaced with something new. I think that sometimes these new ideas come from people with something to sell rather than from people who have done reproducible research. That's a problem and a reason that we need rigorous research with reproducible results. That requires funding.

Tim Bell - Professor at University of Canterbury

That CS Unplugged has been viewed as a replacement for programming, not as an entree, to the extent that in some places, CS Unplugged has been used as an excuse for not investing in devices and comprehensive programming education.

I love CS Unplugged activities and when I use them I use them to lead into programming. I think that a lot of people use them as a filler for times when they don’t have equipment to use with students. That’s a shame. I think some of this is because there isn’t any real PD in how to use these tools as integrated into introducing programming concepts. PD and education research play into all of this.

I think the messages from all three of these wonderful people tie together and show the need for research into pedagogy and education for teachers. Education into how to teach concepts!

Monday, November 03, 2025

Flag on the Play AI Let Me Down

My latest coding involves an attempt to memorize nautical signal flags. I’ve played with this idea in the past but never had the time to really dig into it. I’ve had images of the flags for years. I’d even started created a class to hold the data.

Image _flag;
String _mnemonic;
String _shortName;
String _morseCode;

Yes, at some point I want to learn Morse Code as well. Always plan for additions. Semaphore is in my thinking as well.

Once again, Copilot, the AI in Visual Studio, has jumped in to help. Or to try to help. It was pretty helpful with some tedious coding. Specifically, with a couple of lines entered it figured out how I wanted to add images and what not to the individual flag objects I wanted to create. Hitting tab and return was pretty easy compared to typing whole lines in.

A = new Flag(Flag_Host.Resource1.alpha, "Alpha", "A", ".-");

I had already added the image files to the project of course. Copilot was not always so helpful though. I created a couple of additional forms for the project and wanted to pass the array for flags objects to the new forms. Copilot struggled to code that properly and there were several false starts.  I used to do that sort of thing regularly but it’s been a few years. I guess my memory isn’t what it used to be. I finally figured it out. Honestly, this should have been easy for Copilot and for me.

I have heard from a number of teachers about how Copilot is showing up in their classes. One teacher uses MonoGame and tells me that Copilot is so unreliable with MonoGame that his students turn it off. My suspicion is that there is not enough good MonoGame code loose on the internet to properly train Copilot.

That leads to a major concern I have about using AI for coding. It’s usability and reliability depends on the quality and quantity of the code used to train it. Programmers love to reinvent the wheel so there is a lot of code available for doing common things in coding. I would expect AI to handle most common data structures pretty well. Some things that are not as common may not have as much code to study. I wonder how well AI will handle new programming languages?

I also wonder how well AI will handle new and unique problems. Will the AI be dependent on very detailed prompts from user developers? I think that is likely. I also think that some person is going to have to do a lot of verification of said code. We are still going to need people who can read and write code.

In a related note, several times while writing this post, I have dipped into raw HTML because I didn’t like how the program I use, Windows Live Writer, was formatting the text.

Friday, October 31, 2025

Unexpected Help With Coding Projects

Fair warning, this is a post in two parts. First a project idea and second musings on the tools I used to create it.

I really do like to write code for fun. Nothing complicated (been there, done that, got the T-shirt - literally) but just little things to "scratch an itch" as they say.

Lately as I played Wordle I was wondering which letters appeared most in each place in the five letter words in my word list. A couple of nights ago, I wrote some code to find out. I had my code output a comma delimited file so I could use Excel to look at the results. That’s what the image to the side shows.

Now this sort of thing is highly dependent on the word list of course. But for my list, S is the most common letter in the first and fifth location. Not surprising as S is used to make plurals. Wordle doesn’t use plurals so I note that the second most common fifth letter is E with Y a close second.

The letter A is the most common second and third letter. The letter E is the most common fourth letter.

If I were ambitious, I could probably use this information to make a smarter Wordle solver. I’m not quite that ambitious though. I am toying with gathering some other statistics though.

I develop using Visual Studio – the full blown version. That means that Copilot jumps in to help. That’s not something I anticipated when I started but I confess that I found it surprisingly helpful. I did specifically ask Copilot to write one specific method – generate a string array of two character combinations – but it jumped in on its own with a couple of small bits of code. I was surprised at how well it anticipated what I wanted.

The implications for teaching programming are something to think about. On one hand it’s scary that AI tools can so easily write coding solutions to simple programming assignments. That turns our process of evaluating learning on its head a bit. At the same time, I am not ready to blindly trust AI generated code. I do not want students to blindly trust it either. So asking students to test generated code seems like a reasonable thing to assign. Yes, I suppose some students will ask AI to generate test cases but if we can’t trust AI to write the code in the first place we can’t trust the generated test cases.

We could ask students to explain the test and related tests. Could be quite a recursive rat hole.

We can also ask students to explain the generated code. We should probably ask them to do that either verbally or by writing manual in class so they can’t ask AI to do it for them.

What I keep coming back to in my own thinking is a focus on abstraction and top down design. Can we ask students to break the problem down to component parts and have them prompt the AI to implement various methods and code pieces. A focus on design rather than writing code. We could have students submit the design document and the various prompts that they use. Add to that some serious examination of testing and verification.

Students are going to have to work with artificial intelligence. They can’t let it do all the work for them because AI is not I enough yet. I don’t think it ever will be either.

Sunday, October 26, 2025

User Interfaces and Microwaves and Artificial Intelligence

It seems like just about everything has a user interface these days. It is sometimes hard for me to question them. What sort of decisions go into their design? Microwaves are one such thing that I keep thinking about. My current microwave defaults to pushing a number button running that many minutes. That’s great when you want it to run in whole numbers of minutes. What about fractions of minutes?

For fractions of minutes there is a button that is pressed first to let the microwave know you want to enter the number of seconds. So far so good. It can get complicated though if you don’t have the default whole minutes option.

My previous microwave did not default to whole minutes. If you enter 100 is that one hundred seconds or 100% of a minute? i.e 60 seconds? How is the decision made on something like that? What is intuitive to the user? Actually, I don’t know what my current microwave would do if I asked to seconds and entered 100. I think it would do 100 seconds as 90 does run for a minute and a half. I should try it I suppose.

It’s a computer related question of course because there is a little microprocessor in there somewhere and someone has had to program answers to these questions. I wonder how artificial intelligence would make UI decisions about things like this. It largely depends on the instructions or prompts given to the AI. People are going to have to have some input there. Right?

Will AIs have access to research on things like that? Will they be able to design and run human factors research? Will they think research is necessary or even desirable or just assume they know what is best for us?

Thursday, September 04, 2025

An Interesting School Year in Computer Science Education

Mike Zamansky is Looking at the start of school for 2025 on his blog C’est la Z He’s thinking about phone bans and AI in schools. I have been thinking about both of those as well. I spent some time recently with the teacher who is now teaching in my old computer lab. He’s also a former student of mine. We had a great conversation.

We talked a little about the cell phone ban in schools that was passed into law in New Hampshire among other places over the summer. It is not clear how it will be enforced and what sorts of consequences will be in place for violations.  For a while, I taught with AppInventor which meant that phones were an active and essential part of the class. I wonder what these bans will mean for all the many teachers and students using AppInventor and similar tools.

Phones were a distraction but teaching in a computer lab with computers in front of every students means the Internet is still going to be a distraction. Classroom management is hard enough without computers and cell phones.

Artificial Intelligence is going to be even more interesting this year. How much to allow? How to check for its use? What to teach about it? All interesting questions that teachers and schools will struggle with this year.

My son, a school administrator, find AI tools very useful. So do many others both in and out of education. Clearly, students need to be taught about AI. That debate is, I hope, over, What and how to teach it are still largely to be determined.

Students are going to use AI to write code for them. It would be foolish to deny that. They still need to understand the code that AI is writing for them. Talking to my teacher friend I used the example of HTML. I write these blog posts using Open Live Writer which builds the HTML that gets posted. It does a great job but I still find myself jumping into the HTML to do some fine toning. In this post, for example. I went into HTML to edit the text for the link to Mike’s blog. A small example but knowing what to do saved me a small amount of time.

To be honest though, students using AI to write their code is not my most serious concern. Ethical concerns around AI use is my biggest concern. There are all sorts of issues around copyright for example. The use of books and art to train AIs to create without giving credit to original creators is an important discussion topic. Taking credit for AI output is another. I want students to think about these sorts of things. There is a lot more and more issues will be showing up.The old question is not so much what can we do but what should be do.

So, yes, we want to teach students how to prompt AI. We want them to be able to evaluate to AI product as well. There is a real risk of AI having a negative effect on people actually thinking. Teachers need to find ways to encourage students to think about what AI is, how it can be used, and most importantly how it should be used.

This year is going to be an important one in the future of AI in education.

Sunday, August 24, 2025

Tiny Book of Simple Cryptography

For the last several years, I have been playing around with simple cryptography. I have made some of results of this available as a free PDF download as a book I call Tiny Book of Simple Cryptography. (TinyCrypto.pdf) I recently put some additional work into it and the latest version is available at the link above.

There are currently a baker’s dozen cryptographic methods described in the book. (List at the bottom of this post) Each write up includes a section on:

  • Introduction
  • Encrypting
  • Decrypting
  • Cryptography Issues
  • Project Suggestions

If a PDF is not to your liking and you would like an actual book, I have created a book you can order through Amazon.com. Maybe for a classroom or school library? Or maybe because you find books easier to browse through. It’s there. There is also a Kindle version available here.

 

Methods covered

  • Caesar Cipher
  • Vigenère cipher
  • Wheel Cipher
  • One Time Pad
  • Polybius Square
  • PigPen Cipher
  • Columnar Transposition Cipher
  • Keyword Columnar Transposition Cipher
  • Random Block Transposition Cipher
  • Steganography
  • Bacon’s Cipher
  • Book Ciphers
  • Playfair cipher