Learn elementary combinatorics and its application to magic squares and Sudoku in this video tutorial by Charles Kelly. These are explained in the context of computer science and data science to technologists and students in preparation for machine learni
- View Offline
- Exercise Files
- Throughout this chapter, I'll use NumPy and Python…to convert the heuristic that I've described in this video…into a Python based algorithm.…NumPy uses rectangular arrays as its basic data structure.…This arrangement is not new to NumPy or Python,…or even to computers.…Humans have been searching for patterns…and organizing those patterns…since the dawn of history.…Magic squares are an example…of a highly organized numeric patterns.…
A magic square is a square array of numbers.…The magic in the magic square…is that the sum of the numbers in each row…and each column equal the same number.…If the numbers along the diagonal also sum to this number,…the magic square is known as a pandiagonal magic square.…If we extend the magic square…into multiple dimensions,…the magic square is known as a magic cube.…
In this case, the order of the magic square is three.…That's because each column and each row…has three numbers.…According to this article,…magic squares were known to Chinese mathematicians…as early as 650 BC.…According to the legend,…
- Using Jupyter Notebook
- Creating NumPy arrays from Python structures
- Slicing arrays
- Using Boolean masking and broadcasting techniques
- Plotting in Jupyter notebooks
- Joining and splitting arrays
- Rearranging array elements
- Creating universal functions
- Finding patterns
- Building magic squares and magic cubes with NumPy and Python
Skill Level Intermediate
2. Create NumPy Arrays
3. Index, Slice, and Iterate
4. Plots: Matplotlib and Pyplot
5. Manipulate Arrays
6. Short Examples
7. Extended Examples
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.