Demystifying Computing with Magic, continued 2012-03-07 Denver, CO.

Slides:



Advertisements
Similar presentations
Playing games in the K-2 classroom
Advertisements

IGNITE – Fun with Math J. Sriskandarajah AMATYC Conference Anaheim, October 31, 2013
NUMBER TRICKS.
Algebraic Word Problems
Helping your child meet their maths target Lots of games and activities for you to choose from! Target focus: Add and subtract multiples of 10,100 and.
X Australian Curriculum Year 5 Solve problems involving multiplication of large numbers by one or two digit numbers using efficient mental, written strategies.
Spot the Pattern On the next slide is a grid and on each subsequent slide there are 4 pieces of information. Can you work out how the grid should be coloured.
Sorting and selection – Part 2 Prof. Noah Snavely CS1114
Sorting Algorithms. Motivation Example: Phone Book Searching Example: Phone Book Searching If the phone book was in random order, we would probably never.
Searching and Sorting Topics  Sequential Search on an Unordered File  Sequential Search on an Ordered File  Binary Search  Bubble Sort  Insertion.
CS 61C L02 Number Representation (1) Garcia, Spring 2004 © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c CS61C.
A R R A Y ! for Multiplication!!
Long Multiplication What is long multiplication?
Creative thinking in mathematics. Objectives  To consider the importance of mathematical thinking and reasoning  To explore a range of thinking skills.
Binary Conversion In today’s lesson we will link together the binary and algorithm topics by looking at how to get the computer to: convert binary to decimal.
Rapid Recall Activities. Retention of facts is key with the New Curriculum Rolling Dice: Rolling a 10-sided dice and making number bonds to 10 Adding.
NCTM Conference April  Domain: Operations & Algebraic ThinkingOperations & Algebraic Thinking  K.OA.3  Decompose numbers less than or equal to.
Blaise Pascal Born: June 19, 1623 Clermont Auvergne, France
Warm-up Problem 2 Write three positive integers in a line. In the space just below and between each pair of adjacent integers, write their difference.
Algebraic Structures: An Activities Based Course MATH 276 UWM MATH 276 UWM.
Illuminating Computer Science CCIT 4-6Sep
31 lesson starters for all abilities
Probability Topic 5: Probabilities Using Counting Methods.
The Pigeonhole (Dirichlet’s box) Principle
NUMBER SENSE AT A FLIP. Number Sense Number Sense is memorization and practice. The secret to getting good at number sense is to learn how to recognize.
Welcome to Dingo State School Numeracy Afternoon.
Basic Counting. This Lecture We will study some basic rules for counting. Sum rule, product rule, generalized product rule Permutations, combinations.
Project done by Khatniuk Svetlana. Through games children experiment and discover. Games add variation to a lesson and increase motivation. The game context.
Searching and Sorting Topics Sequential Search on an Unordered File
CS212: DATA STRUCTURES Lecture 10:Hashing 1. Outline 2  Map Abstract Data type  Map Abstract Data type methods  What is hash  Hash tables  Bucket.
Big Ideas & Better Questions, Part II Marian Small May, ©Marian Small, 2009.
Sequencing 1 Shuffle the cards and place in a pile with the numbers facing down. Order the cards from 0 to 11. How fast can you do this?
Math Games Compiled By: Joan Bartlett and Heather Bartlett.
Dice Games for Math. Multiplication War Skill: Multiplication facts to 36 Players: 2 to 4 players Supplies: 2 dice and counters (such as M&Ms, Cheerios,
First of all, pick the number of times a day that you would like to have chocolate (more than once but less than 10) Multiply this number by 2 (just to.
Today’s Plan: -Mental math with decimals -Multiply decimals -Add and Subtract Decimals 11/17/10 Decimals Learning Target: -I can solve problems containing.
CS 361 – Chapters 8-9 Sorting algorithms –Selection, insertion, bubble, “swap” –Merge, quick, stooge –Counting, bucket, radix How to select the n-th largest/smallest.
Coaching Pack 9 – 11 Years. What Am I Coaching Today? What Might the Players Learn or Get Better at? TechnicalPsychological example PhysicalSocial example.

Activity 1: Play Fours Play in pairs Each player has a 3 by 3 grid Take turns to roll 2 dice Calculate the total- each spot is worth 4 points Write your.
07/12/ Data Representation Two’s Complement & Binary Arithmetic.
COSC 2007 Data Structures II Chapter 13 Advanced Implementation of Tables IV.
ROUNDABOUT You will need the timer. Divide the children into two groups. One half makes a circle and walks clockwise. the other half makes a larger circle.
Demystifying Computing with Magic Raleigh, NC.
 Take a card  Solve the task  Record your solution on a post-it  Find 3 other people with the same result.
PSSA Prep Answering an Open-Ended Question Testing for Math & Reading March 12 th – 23 rd.
Lecture Coursework 2 AGAIN. Rectangle Game Look at proof of matchsticks A rectangular board is divided into m columns by n rows. The area of the board.
 B-tree is a specialized multiway tree designed especially for use on disk  B-Tree consists of a root node, branch nodes and leaf nodes containing the.
PROBLEM-SOLVING TECHNIQUES Rocky K. C. Chang November 10, 2015.
NUMBER SENSE AT A FLIP.

Thinking is at the heart of Mathematics and therefore should be at the heart of mathematical teaching and learning.
Methods for Multiplication Tutorial By: Melinda Hallock.
Confidential1 Multiplying Decimals. Confidential2 WARM UP – = = – = Is it true?
Computational Thinking Activities The Magic of Computer Science
AUW Math Center. Magical Card!  Pick a card except Ace,10s, Jack, Queen and Joker  Multiply it by 2  Add 2 with it  Multiply by 5 with the total 
09/03/20161 Information Representation Two’s Complement & Binary Arithmetic.
Binary & Normalization What is Normalization? We discussed this the other day (special review session slides, near the end) Can someone tell us.
Welcome to Family Math Night Thank you so much for joining us! 1.Please find a seat with your parent. 2.Find your Math kit on the stage. 3.Make sure you.
An Overview of The First Grade Math Common Core Standards Presented by: Winnebago School’s First Grade Team February 2013.
By: Megan Funk. I will: 1. Explain the binary number system How to: -Generate binary from a number -Add binary 2. Explain the base-b number system 3.
LO: to recognise < > and = symbols
Basic Counting.
What makes a good mathematical game?
Topic 1: Problem Solving
Lower KS2 Maths Workshop 1st February 2018
15 things in 30 minutes 15 new activities to strengthen number work
Two’s Complement & Binary Arithmetic
Presentation transcript:

Demystifying Computing with Magic, continued Denver, CO

2/42 Demystifying Computing with Magic, continued Special Session Overview  Motivation  The 7 magic tricks  Real-Time 4x4 Magic Square  Left/Right Game  The Tricky Dice  The Numbers Game  Find the Card  Guess Your Age  Guess Your Birthday Day of Week  Reflection  Other References  YOU contribute your tricks

3/42 Demystifying Computing with Magic, continued Magic is Fun!

4/42 Demystifying Computing with Magic, continued but Magic can be much more than fun!

5/42 Demystifying Computing with Magic, continued Magic can Motivate, Illustrate, Elaborate…  Computing notions  Discrete math terms: e.g., permutations,  Problem representation: e.g., binary digits  Algorithmic patterns: e.g., sorting  General notions: e.g., symmetry  Problem solving  Problem decomposition  Simplification, Generalization  Backward reasoning  Analogy (transfer)  Problem representation

6/42 Demystifying Computing with Magic, continued  Volunteer is asked for a number N from  You create a magic square, where the sum of each row, column and diagonal is N  Source: Real-Time 4x4 Magic Square N N N NNNN N N N All add to…

7/42 Demystifying Computing with Magic, continued  Mechanics  Make-Magic-Square(N)  Have a grid with the value already written faintly (or memorize it)  What they learn  Value of lookup table  Correctness proof  Decomposition  Algebraic representation  Value of randomness  8 rotations-and-flips How it Works; What Students Learn N N N N N N N NNNN N N N

A line of 2N integer cards Two players, alternating turns Each player, on her turn, takes a card from one of the line ends (left or right) The winner is the player whose sum of N cards is larger

A volunteer from the audience arranges the line of 2n cards as she wishes The magician looks at the line for a few seconds; then turns his back to the cards The player plays against the magician, while the magician does not see the line of cards The magician is the 1 st player, never loses

Take the larger end But, maybe the larger end yields a good move for the opponent?

Take the card from the end with the better “delta” But, is it sufficient to look locally?

Identify the locations of the larger cards, and try to get these cards But, how to guarantee getting them?

Apply dynamic programming - solve the game for: all pairs, all triples, all quadruples …

Not simple to program Requires O(N²) time, O(N) space (or even O(N²) space, if not experienced)

Employ divergent thinking / creativity The game involves selection from alternative locations; so maybe look, for a moment, only on locations and not on values

The leftmost card is initially in an odd location and the rightmost card – in an even location If the leftmost card is removed, then the two ends will be initially-even locations (2 nd, 12 th )

If the leftmost card is removed, then the two ends will be initially-even location (2 nd, 12 th ) If the rightmost card is removed, then the two ends will be initially-odd location (1 st, 11 th )

After I remove the card from the 1 st location, both ends will be the 2 nd and 12 th locations; after my opponent will remove a card, there will again be an end of an initially-odd location; I may remove it, and again leave ends of initially-even locations

Following the above, I may play as follows: “after each of my turns, both ends will be initially-even locations”, or: “after each of my turns both ends will be initially-odd locations”

Sum separately the values in the even locations (here – 32) and the values in the odd locations (here – 33). Then, start with the end of the higher sum, and just “imitate” the opponent’s moves

Greedy algorithms (be careful …) Dynamic programming Invariance Values vs locations (addresses) Divergent thinking

23/42 Demystifying Computing with Magic, continued  Participant puts dice in a glass  Magician guesses the numbers on the bottom  Source: Math Magic The Tricky Dice 1 and 4

24/42 Demystifying Computing with Magic, continued  Mechanics  Opposite die sides sum to 7  Answer is (7-die 1, 7-die 2 )  Students Learn  Good design (in how the pips on a die are chosen)  Simple algorithm  Complements How it Works; What Students Learn Mirror

25/42 Demystifying Computing with Magic, continued  Participant calls out 10 numbers  Magician writes numbers on paper, turns them over  Participant picks random one, magician guesses number  Source: CS4FN The Numbers Game 49, 124, 5, 6, 8, 19, 233, 69, 1, 99 49

26/42 Demystifying Computing with Magic, continued  Mechanics  Write 1 st number on all cards.  You never promised anything more than that!  Students Learn  HCI design principle  You developed a mental model  That wasn’t how things worked  It’s important to make the critical parts of the internal system visible to the user so they see what state it’s in. How it Works; What Students Learn 49, 124, 5, 6, 8, 19, 233, 69, 1, 99 49

A volunteer from the audience arranges the cards 1..N in some permutation Magician-1 looks at the line for a few seconds; leaves it as is, or swaps two cards Magician-2 enters the room, and the audience calls out any of the integer 1..N Magician-2 finds the called integer in at most N/2 attempts

Each value is in the range of the card locations; look at values as pointers (?)

Each card points-at exactly one other card, and is pointed-by one other card

Each card is in exactly one cycle; the card in the i th location is in a cycle with the card whose value is i, which is it’s predecessor in the cycle

Thus, we may reach the card with value i, by following the pointers starting from the i th card; the amount of work will be the length of the cycle that we follow

There may be at most one cycle of length larger than N/2; if such a cycle exists, then we may break it into two cycles, by swapping two of its pointers

Swap the cycle’s middle with its start

So, if there is a cycle of length larger than N/2, break it after at most N/2 hops into two smaller cycles; each of the cycles will not exceed the length of N/

Values as locations (pointers) Cycles of values in a permutation A cycle may be broken into two cycles by swapping the locations of two of its pointers Divergent thinking

36/42 Demystifying Computing with Magic, continued  Volunteer is handed several cards with “random” numbers written on them  Returns the cards with age listed on them  Magician glances and says the person’s age  Source: Math Magic Guess Your Age A B C D 13 A, B, D

37/42 Demystifying Computing with Magic, continued A B C D  Mechanics  Every card is a column in the binary table  E.g., “2 1 = 2 card has { 2, 3, 6, 7, 10, 11, 14, 15 }  The first number in the list is the number of the card.  Just add those together  Students Learn  Intro to Algorithms  Binary numbers  Encoding  Lookup table for quick calc! How it Works; What Students Learn N A, B, D

38/42 Demystifying Computing with Magic, continued  Volunteer is asked for their birthday  Magician says what day of the week it was  Source: en.wikipedia.org/wiki/Zeller%27s_congruence Guess the birthday day of the week Thu “June 23, 1912”

39/42 Demystifying Computing with Magic, continued  Mechanics  Complicated general alg:  Easier: M, D, Y in 1900s  Turing: June 23, 1912 (6/23/12)  Sunday!  Algorithm  If M =1 or 2, Y = Y - 1  (F(M) + D + Y + Y/4) % 7  1-index: 1=Mon, 2=Tue, etc.  Y/4 fast by 20s: 0,5,3,1,-1  Example  ( ) % 7  ( ) = 7 (Sunday!) How it Works MF(M ) My memory trick 11“1 and 3 pass through” 2424 hours in a day 33“1 and 3 pass through” are flips 57Heinz 57 sauce are flips 76Spirit of is made up of 2s 95Working 9-to-5 100Only # with 0 … is 0! in Binary is 3 125Working 12-5 (afternoons)  What they learn: Don’t nec generalize  Alg, value of lookup table, modulo YY/4%

40/42 Demystifying Computing with Magic, continued  Paul Curzon, Peter McOwan, Jonathan Queen Mary, University of London  CS4FN magazine  Two free books on Magic and CS!  Some online apps  If you’d like to contribute tricks, contact them… Great Resource : CS4FNwww.cs4fn.org/magic

41/42 Demystifying Computing with Magic, continued  Kids Labs, $12  They include dice, cards, calculator, templates, …  Some of our tricks we demonstrated today were from this great resource! Great Resource : Math Magicwww.cs4fn.org/magic

Motivate, Illustrate, and Elaborate on: - Computing notions - Problem solving - Divergent Thinking Audience Participation Do YOU have any magic to share?