Showing posts with label Christmaths. Show all posts
Showing posts with label Christmaths. Show all posts

Thursday, 14 December 2017

On The 'Mystery Calculator' Trick

'The Mystery Calculator' trick is a perennial, favourite 'surprise gift' found in Christmas crackers[1]  — along with the (hard) plastic moustache/slug, the fortune-telling fish, and perhaps (if you're lucky) a die.

For a maths teacher, 'The Mystery Calculator' is a potent conceit that piques students' interest and that — when used carefully[2] of course — levers and encourages strong, mathematically mature thinking.  After playing the trick out on/with students, it is demystified carefully, and collectively, before students use their newfound knowledge and understanding creatively in devising a different trick, based on the same principles.  (A ppt version of the cards, one card per slide, can be downloaded here.)


The Trick
  • Ask someone to choose a number from any of the six cards.
  • Show them each card in turn and ask them if their number appears on it.
  • Add the numbers in the top left-hand corner of each card that contains their number.
  • The total is their number.













    The How / Why

    The number 1 in binary is (1 x 2⁰)  → (1)10 = (1)2  → Hence the number 1 appears on the 1st card only.

    The number 2 in binary is 10... (1 x 2¹) + (0 x 2⁰)  → (2)10 = (10)2  → Hence the number 2 appears on the 2nd card, but does not appear on the 1st or any other.

    The number 3 in binary is 11... (1 x 2¹) + (1 x 2⁰)  → (3)10 = (11)2  → Hence the number 3 appears on the first 2 cards, but does not appear on others.

    The number 4 in binary is 100... (1 x 2²) + (0 x 2¹) + (0 x 2⁰)  → (4)10 = (100)2  → Hence the number 4 appears on the 3rd card but does not appear on the 1st or 2nd, or any other.

    The number 5 in binary is 101... (1 x 2²) + (0 x 2¹) + (1 x 2⁰)  → (5)10 = (101)2  → Hence the number 5 appears on the 1st and 3rd cards, but does not appear on the 2nd, or any other.

    The number 6 in binary is 110... (1 x 2²) + (1 x 2¹) + (0 x 2⁰)  → (6)10 = (110)2  → Hence the number 6 appears on 2nd and 3rd cards but does not appear on the 1st, or any other.

    The number 7 in binary is 111... (1 x 2²) + (1 x 2¹) + (1 x 2⁰)  → (7)10 = (111)2  → Hence the number 7 appears on on 1st, 2nd and 3rd cards, but does not appear on any other.



    The number 41 in binary is 101001... (1 x 2⁵) + (0 x 2⁴) + (1 x 2³) + (0 x 2²) + (0 x 2¹) + (1 x 2⁰)  → (41)10 = (101001)2  → Hence the number 41 appears on the 1st, 4th and 6th cards but does not appear on the 2nd, 3rd or 5th.



    The number 62 in binary is 111110... (1 x 2⁵) + (1 x 2⁴) + (1 x 2³) + (1 x 2²) + (1 x 2¹) + (0 x 2⁰)  → (62)10 = (111110)2  → Hence the number 62 appears on the 2nd, 3rd, 4th, 5th and 6th cards, but does not appear on the 1st.

    The number 63 in binary is 111111... (1 x 2⁵) + (1 x 2⁴) + (1 x 2³) + (1 x 2²) + (1 x 2¹) + (1 x 2⁰)  → (63)10 = (111111)2  → Hence the number 63 appears on all six cards.


    Possible Teaching Approaches

    Thinking through some possible starting questions for students to consider (or to consider with students), before moving on perhaps with students creating their own 'Mystery Calculator' trick (see also [3]):
    • What do you notice about the numbers on each card?
    • Do these patterns matter — what could we do to see if they do?
    • Can we have a number larger than 63 on any of the cards?
    • What about all of the other numbers on the cards — can they be chosen randomly?
    • What number would appear on all cards if there were four, five, seven, ten, ... cards?  
    • Does the number in the top left-hand corner have to be there?
    • Are there any constraints to the numbers we place on the cards?
    • Would a similar trick in another base, maybe base-3, be more magical?
    • How high can we count in binary on our fingers? (Watch this Ted-Ed video from James Tanton.)





    Notes & (Select) Links:

    [1]  See here for an example, or here.

    [2]  See 'When Magic Fails in Mathematics,' by Junaid Mubeen.

    [3]  See this by Katie Steckles in The Aperiodical'On Disreputable numbers'.

    For other Christmathsy problems to consider with students, try the 'Santamaths' problem, the '12 Days of Christmas' problem, see this selection from @mathsjem, and have a look at my 'xmaths card'.


    Monday, 27 November 2017

    On the little things in teaching #1

    That beautifully judgemental silence from a class faced with your meticulously engineered pun, which, as a function of their understanding of the concept underpinning it, can only mean that they really get it...






    M
    ME [during a discussion about correlation]:
    Yes, the more overweight men with white beards wearing red suits we see, the greater the chance it is that it's nearing Christmas.  That's a good example.  So, could we say this in a more statty way?

    STUDENT:
    There is a strong positive correlation between the number of overweight men with white beards and red suits and when Christmas is.

    ME:
    I'm not sure how we could judge the strength, but other than that yes, we can say that there is a positive correlation between the number of overweight men we observe with white beards wearing red suits and how close Christmas is.  Or maybe it's a negative correlation?  I don't know.  Does it matter?

    STUDENT:
    Yes, because the more men you see dressed up as Father Christmas, the less time it is until Christmas.

    ANOTHER STUDENT:
    But you could say that the closer Christmas is the more people we see dressed up as Santa.  And that's more positive... But I suppose we're saying the same thing.

    ANOTHER STUDENT:
    But if you drew a graph with the date on the x axis and the number of people dressed up as Santa on the y, it would go up.

    ME [slightly panicky; the chance for the pun slipping away]:
    It's a bit like the chocolate consumption and Nobel Prize data we looked at [see here].  Before I told you what the data was, you assumed that more of x would make more of y.  But when you saw what the data was...

    STUDENT:
    ...Oh that thing where the more chocolate people ate in a country the more Nobel prizes they won...

    ME:
    Yep.  So when we read that graph, or misread it...

    STUDENT:
    It would mean that you have more chance of winning a Nobel Prize if you eat a lot of chocolate.

    ANOTHER STUDENT:
    Which is just dumb...

    ME [quickly]:
    Which is why describing it in more of a statty way is safer.  So, if we think about the men dressing up as Santa example in the same way, what would we be saying?  What would it mean if we thought about it in the wrong way?

    STUDENT:
    If we wanted Christmas to come quicker we would just need to see more people dressed up as Father Christmas...

    ANOTHER STUDENT:
    Or that we could make Christmas come quicker by getting more people to dress up as Santa.

    ME [relieved]:
    Exactly.  But the fact that we see an increase in overweight men with white beards wearing red suits as we get closer to Christmas, does not cause Christmas to come quicker does it?  Do you get the distinction?  If we wanted Christmas to be tomorrow would we just get millions of people to dress up as Santa?  No, of course not. The important thing to get here is that correlation may suggest a relationship between two things, but it does not imply Clausality.

    AyThangYaw.



    (See here for a selection of correlation and causation conflations.)


    Friday, 17 November 2017

    On Santamaths (An xmaths conversation with a 5 year old)




    OK, let's get straight to the point: it is a fallacy, or to put it another way, a gross oversimplification to think that Santa will deem you, in binary fashion, to have been either naughty or nice, discretely, categorically, one way or the other, and that this will in turn delineate whether you receive presents or not.  This is — plainly, to put it politely, and as I will show in what follows — utter horse nonsense.  There are gradations of naughtiness or niceness: one person can be naughtier than another, or nicer, and it is evident to boot that naughtiness is a function of niceness, and vice-versa.  To put it another way, an increase in naughtiness (say η) and a decrease in niceness (say η) are biconditional:
    \[\rlap{-} \eta \;\; \Leftrightarrow \;\;\eta \]
    To elaborate: Sometimes you will be naughty and sometimes you will be nice. And of course the more you are naughty the less time you have to be nice — and vice-versa: the more you are nice the less time you have to be naughty.  So, and in other words, the naughtier you are the less likely it is that you will be nice, and the nicer you are the less likely it is that you will be naughty.  Yes?  The truth is that two naughty people will be naughty to different degrees: one will be more or less naughty than the other.  (The same is obviously true for two nice people.)  And of course, one naughty act might not be as naughty as another, so there are gradations of naughtiness and, indeed, gradations of niceness.  It is nice to say please and thank you, for example, but it is nicer to slot a pound into a Noddy car ride in the shopping centre and leave it to be discovered by an unsuspecting — but soon to be overjoyed — toddler.  Similarly, it is naughty to take your sister's cuddly Pooh bear when she doesn't want you to, but it is naughtier to hide Pooh and tell your sister that he’s run away because he doesn’t love her her anymore.

    Santa is not stupid; he knows all of this.  And he uses Santamaths to deal with the inherent variability in η and hence η.  Put simply, he uses relative frequencies to assign a weighted 'niceness index' (known as the ηi pronounced /niː/) to each person (𝓍), and the presents each person receives are thus dependent on such.  In short:

    \[\begin{array}{l}\forall x,\;0 \le {\eta _i} = \frac{\eta }{{\eta  + \rlap{-} \eta }} \le 1\\\\and\;as\;{\eta _i} \to 1,\;\forall x\left( {\rlap{-} \eta  \Rightarrow \eta } \right),\\and\;P\left( {x\;gets\;what\;s/he\;wants} \right) \to 1\\\\Similarly,\;as\;{\eta _i} \to 0,\;\forall x\left( {\eta  \Rightarrow \rlap{-} \eta } \right),\\and\;P\left( {x\;gets\;what\;s/he\;wants} \right) \to 0\end{array}\]
    Santa then uses probability theory and combinatorics to calculate what and how many presents you get.  As such, this year, as you know, I have been keeping a tally of all the times you have done something naughty (η) and all of the times you have done something nice (η).  You get one scratch for a naughty act and one for a nice act, an act of kindness if you will, and dependent of course on the act.  Remember that time you fooled your sister  your type 1 hypersensitive to tomatoes sister  into thinking that ketchup you had mixed in her ice-cream was actually raspberry juice, well that got you ten scratches in the naughty column, for example, whilst tidying up your Lego without being asked that one time you did it in the whole year got you five scratches in the nice column.  

    Here's a little section of the tallies I've been keeping for this year:
    Overall you had 740 naughty scratches this year and 623 nice scratches, giving ηi = 0.46:
    \[\begin{array}{l}\begin{align}\frac{{623}}{{740 + 623}} &= \frac{{623}}{{1363}}\\\\ &= 0.46\end{align}\end{array}\]
    Now, this doesn't mean that you have a 46% chance of getting your presents this year.  Oh no.  You wrote to Santa to ask for the following five presents: 
    • An umbrella in the shape of an Octopus, 
    • A Lego Batman car [I presume you mean the Batmobile]
    • A green and orange ukulele, 
    • A dinosaur that can really move and roar and scare people like a monkey on a horse, 
    • A helicopter (remote-controlled will do if Santa can't source a real one for you). 

    Hence the following Santamaths model applies:

    \[\begin{array}{l}{\left[ {{\eta _i} + \left( {1 - {\eta _i}} \right)} \right]^5} = {}^5{C_5}{\left( {{\eta _i}} \right)^5}{\left( {1 - {\eta _i}} \right)^0} + \\\quad \quad \quad \quad \quad \quad \quad \quad \quad {}^5{C_4}{\left( {{\eta _i}} \right)^4}{\left( {1 - {\eta _i}} \right)^1} + \\\quad \quad \quad \quad \quad \quad \quad \quad \quad \quad {}^5{C_3}{\left( {{\eta _i}} \right)^3}{\left( {1 - {\eta _i}} \right)^2} + \\\quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad {}^5{C_2}{\left( {{\eta _i}} \right)^2}{\left( {1 - {\eta _i}} \right)^3} + \\\quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad {}^5{C_1}{\left( {{\eta _i}} \right)^1}{\left( {1 - {\eta _i}} \right)^4} + \\\quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad {}^5{C_0}{\left( {{\eta _i}} \right)^0}{\left( {1 - {\eta _i}} \right)^5}\end{array}\]
    and inputting the respective values for ηand 1 – ηi...

    \[\begin{array}{l}{\left[ {{\eta _i} + \left( {1 - {\eta _i}} \right)} \right]^5} = 1{\left( {0.46} \right)^5}{\left( {0.54} \right)^0} + \\\quad \quad \quad \quad \quad \quad \quad \quad \quad 5{\left( {0.46} \right)^4}{\left( {0.54} \right)^1} + \\\quad \quad \quad \quad \quad \quad \quad \quad \quad \quad 10{\left( {0.46} \right)^3}{\left( {0.54} \right)^2} + \\\quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad 10{\left( {0.46} \right)^2}{\left( {0.54} \right)^3} + \\\quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad 5{\left( {0.46} \right)^1}{\left( {0.54} \right)^4} + \\\quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad 1{\left( {0.46} \right)^0}{\left( {0.54} \right)^5}\\\quad \quad \quad \quad \quad \quad \quad  = 0.0205... + \\\quad \quad \quad \quad \quad \quad \quad \quad \quad 0.1208... + \\\quad \quad \quad \quad \quad \quad \quad \quad \quad \quad 0.2838... + \\\quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad 0.3332... + \\\quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad 0.1955... + \\\quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad 0.0459...\end{array}\]
    So as you can see, there is therefore only a 2.06% chance that you will receive all the presents you have asked Santa for this year — indeed, it is more than twice as likely that you will receive nothing.  The most likely thing to happen is that you will receive 2 of the 5 presents you have asked Santa for, but there is more than a 50% chance that you will receive 2 or 3 of the presents you have asked for. 

    I am sharing this analysis in the detail I am with you so as to prepare you for any possible disappointment on Christmas morning.  I must of course emphasise that this is a purely theoretical model and thus that the experimental error that is life may get in the way, and result in you having all of the presents you have asked for, or, indeed, even more.  (Your sister, incidentally, has asked for 4 presents.  I wonder what proportion of her behaviour would need to have been deemed nice in order for her to have a 90% or more chance of receiving at least 3 of them?)

    Night-night.