posted 1 week ago
Hi Paul,
Good question. Actually I originally wanted to use R for the book, and I even completed the first two chapters with R code, and then the publisher came to me and asked me to switch to Python. I chose R because it's my favorite and it's usually pretty easy for beginners to start using quickly. Python also has low barriers to entry for learners, as any language with a one-line Hello World program would, so I thought it would be reasonable to switch to Python. As for why the publisher wanted Python, well I speculate that it's because they thought it would sell better as a Python book. Many of their bestselling books (and many bestselling books from other publishers) are Python books, and there seems to be a huge demand for beginner- and intermediate-level Python coding books. I'm not really a language partisan, and I can't think of anything in the book that couldn't be implemented easily in any of today's top languages once you understand the ideas. My focus in the book is on the high-level ideas of the algorithms more than on the low-level details of their implementations, which is another reason why I didn't feel concerned about the particular language used for the book.
As for sudoku, actually the book only has a very minimal section mentioning sudoku, and doesn't go into much detail about it. Sudoku is discussed in terms of the P vs. NP problem and the complexity/difficulty of finding solutions, and there's no full implementation of a sudoku solver shown there. I think sudoku (and other simple-seeming games) are very interesting and I'd be happy to talk about sudoku algorithms in a separate discussion (or in the sequel!) but there wasn't room for a full, detailed discussion of it in this book. Thanks and best regards,
Bradford