Trying to find math inside everything else

Archive for the ‘games’ Category

Streak Bonus in the Pokémon TCG

Here’s a fun problem I worked on recently – fun enough that I nerdsniped two of my coworkers about it. Here’s the problem:


In the Pokémon TCG Pocket app, I would earn 10 points for winning a match and lose 7 points when losing a match. However, you also get a win streak bonus – the second win in a row gets a bonus of 3 points, the third gets 6, the fourth 9, and the fifth (and all subsequent) gets 12. Assuming I have a win rate of 50% (which I did at the time), what’s my expected value for playing n games? (How many games would I expect to play to earn x points?)

Below is a journey through my thought process – you can jump to the end if you just want the answer.


I started by writing out the different possibilities of runs of wins and losses for 1 game, 2 games, 3, etc. Thinking that if I listed them by hand I might miss some, I realized that I could use CONCATENATE in a spreadsheet to work recursively – take all the runs from (n-1) games and append a W at the end, then repeat the process with an L. So I did that here:

https://docs.google.com/spreadsheets/d/1izBy3wN-sVFV8SxExDxGC9rNVebEA5C7iPydU_kmP1Y/edit?gid=748567562#gid=748567562

(There’s 3 tiers, each with its own sheet – Master Ball Tier, where you lose 10 points on a loss, Ultra Ball with 7 [the tier I’m in], and Great Ball with 5. It makes sense to work through the problem in Master Ball, so you can just focus on the streak, and then adjust afterwards.)

Notably because I had some errors in my data, my calculated EVs and EV/game didn’t seem like nice numbers, so my first instinct was to turn to statistics. I did a log regression for the EV/game numbers and then used that to calculate when I would hit the number of points I needed (340). [You can just change which function it is to change tiers.]

https://www.desmos.com/calculator/tspirmvama

This felt unsatisfactory and I wondered if my logic was sound, so I roped in the inimitable Sam Shah and talked him through the problem. He voiced his belief that there would be an explicit solution, so that turned me back to my table. As I walked him through it, we found the errors I had, which made things look nicer, so on the right track.

What really matters as you go through each game in the run, once you get past 5 games, is just the final five games. As you go through each game, we’ll notice that there’s a doubling happening. For example, after 2 games there’s 1 way to end in 2 wins, 1 way to end in 1 win, and 2 ways to end in a loss. After 3 games, there’s 1 way to end in 3 wins, 1 way to end in 2 wins, 2 ways to end in 1 win, and 4 ways to end in a loss. Once you get past 5 games, you no longer need to be introducing new sequences to look for, so then they start combining, as below:

For every game that represents a run that ends in 5 wins, I need to add 22 points. For every game that represents a run that ends in 4 wins, I need to add 19 points. And so on. And the total number of possible runs is 2^n, so to get the expected value of a single game, I would need this expression (for Ultra Ball tier):

Then I just need to add that value for every game past 5 onto the value I already calculated for 5 games, and voila!

But wait, you may have noticed that that expression could be reduced. In fact, once you reduce it, it no longer depends on the variable n – it’s constant!


So basically we have linear function with this value as the slope (and a domain of more than 5 games). So I made this graph to represent the three tiers – just input for y how many points you’ll need and the x-value for each intersection will tell you how many games you expect to play for each tier.

https://www.desmos.com/calculator/jdrc6qzrsh

Extension questions: What if I didn’t have a 50% win rate? How low could my win rate go and still have a positive expected value? I leave those as an exercise to the reader.

Derivative Clicker

I was looking for a derivative-based game to play in Calculus as we were just closing out our first unit on derivatives and the semester was ending. That’s when I found Derivative Clicker:

https://gzgreg.github.io/DerivativeClicker/

It hit the spot with my students. I explained the game and had them all start playing simultaneously, and then saw who had earned the most money in 20-25 minutes. Yes, it’s a little addictive and “brain rot” (as one student said, but, like, it was a positive review) but they had a lot of fun.

The thing about math games, though, is that the real power is not in the game itself but in the debrief. Just the lesson before this was my students’ first exposure to the idea of higher order derivatives. They asked “But what does a second derivative actually tell us about the function” and I explained, but it still felt ungrounded to them. So I thought this would help them feel the power of derivatives viscerally.

Then we filled out some tables: what if I just had a single 1st derivative (or, in other words, f'(t) = 1), how much money would I have after time? What if instead f”(t) = 1? f”'(t) = 1? This helped build up the idea of increasing rate and how the rates grew polynomially.

They also had debate question about strategy – in the game, with $500, you can buy 1 second derivative or 65 1st derivatives. Which is better? (There’s no a clear answer here – if you were to buy the second derivative and then walk away, it’ll probably be better for you by the time you get back. But if you buy the 65 1st derivatives, you’ll have enough money to buy a second derivative way before buying a second derivative will get you 65 1sts.)

Below is the debrief sheet we did today.

Integral Limit Game

This year when I was in my intro to integrals unit, I tried to look back at this blog for the second integral game I know I played (besides this one), and saw I hadn’t blogged about it. I had tweeted about it, but now I’m thinking, you know, I should, uh, archive things that I only tweeted about in a more permanent place, in guess Twitter doesn’t last much longer.

Anyway, this game is based on The Product Game, with the same structure of turns – players take turns moving a token on the bottom rows, that then determine which square in the top section, where the first player to get 4 in a row is the winner. (I usually have students play in teams of 2, but I’ll keep saying “player” go forward.)

The idea here is that the bottom rows represent the limits of a definite integral. One player plays as the Upper Limit, and the other as the Lower Limit. Once both limits are placed, the player who most recently went calculates the value of the definite integral on the accompanying graph, then covers the square in the top section with the area. (Remember that if the lower limit is greater than the upper limit, the sign is switched!)

Making the function that would give a variety of answers was a fun challenge. After coming up with a graph I thought looked good, I wound up making an excel sheet to calculate all the possible definite integrals to see how balanced it was, and adjusted.

I’ll include that excel sheet as well, as it’s useful for checking answers (as a teacher), although of course each team should be checking each other. After doing a bunch of different integrals on the same function, students often realize they can use their previous work to help them find new answers, reinforcing the cumulative nature of integrals.

Files

BYORF

One of the other games I made this year was during our rational functions unit: BYORF, which stands for Build Your Own Rational Function. (This was originally a placeholder name, but it kinda grew on me.)

BYORF is a drafting game, a la Sushi Go or 7 Wonders. You play over 2 rounds (because that fit best in our 45 minute period – 3 rounds might be better with more time?), drafting linear factor cards to build into rational functions that match certain criteria. Here’s an example of a round between two players.

In this example, the left player used only 4 of their linear factors (as you don’t need to use all 6). Then we can compare each of the 5 goal cards, which are randomized each round. L has 0 VA left of the y-axis, while R has 2, so that is 3 points to R. L has a hole at (-2, 1/3) while R has a hole at (-1, -2), so L gets 5 pts. They both have a HA at y=-1, so both score those 4. Then we have the two sign analysis cards, which score points if you have that formation somewhere in your sign analysis. R has the first one (around x=3) and both have the second one (L around x=1 and R around x=-3). So after one round, both players are tied with 11 points.

I hope that gets the idea across. The fact that students need to check each other’s work to make sure the points are being allocated correctly builds in a lot of good practice. After we played the game, I did a follow-up assignment to ask some conceptual questions (which is where the above example comes from). I’ve also attached that here.

I hope you have some fun with BYORF!

Letter Scramble

In our combinatorics unit in pre-Calculus, we tend to look at every problem as a letter rearrangement problem. This lets us move beyond permutations and combinations to model any problem involving duplicates. I wanted to build a game that had the students quickly calculate the number of arrangements for a given set of letters, so I came up with Letter Scramble.

The idea behind the game is that students have a set of goal cards with the number of arrangements they want to reach, and a hand of letter cards. On each player’s turn they can play a letter card to change the arrangement, and thus change the total possible number of arrangements. (They can also skip their turn to draw more goal cards, a la Ticket to Ride.)

I calculated all the possible answers you could get using 7 different letters and up to 8 slots, including if some of those slots are blank (and thus make disjoint groups), then determined which of those answers repeat at least once, and assigned them scores based on that.

Possible numbers of arrangements on the left, how many times they repeat in the second column, and the points I assigned them in the third.

One interesting thing about the gameplay is it promoted relational thinking. Instead of calculating each problem from scratch, you can based it on the previous answer you calculated. (So, for example, if the board read AABBCD, that would be 6!/(2!2!) = 180. But if you change that to AABBBD, one of the denominator’s 2! changes to 3!, which is the same as dividing by 3, so it’s equal to 60. No need to calculate 6!/(2!3!) directly.

Some examples of scored goals:

1! * 3!/2! = 3
5!/(2!3!) = 10

The Integral Struggle

I had an extra day to fill for one of my sections of calculus, thanks to the PSAT, so I set about thinking up a game I could play. I gotta tell you, as much as there is a paucity of good content-related math games out there, it’s extra so as you move up the years in high school. I can still find a good amount of algebra and geometry games online, but Algebra 2? Precalc? Calc? Fuhgeddaboutit. Well, I’m teaching both Pre-Calc and Calc this year, so I guess I’ll just have to make them myself. (I brainstormed two more during said PSAT, so those might happen soon enough.)

Starting layout for The Integral Struggle

We just covered function transformations and how they affected integrals, so this game hits on that topic. (Yeah, we’re doing integrals first.) Here’s how it works: there are 3 functions/graphs, each of which has a total area of 0 on the interval [–10,10]. One team is Team Positive, and the other is Team Negative. Teams take turns placing numbers from –9 to 9 that transform the function and therefore transform the area. Most importantly, they also place the numbers in the limits of integration, so they can just look at a specific part of the graph.

With three functions, it becomes a matter of best of 3 – if the final integral evaluates to a positive number, Team Positive gets a point, and vice versa. If it’s a tie at the end of the game, because one or more of the integrals evaluated to 0 or were undefined, then redo those specific integrals. (I discussed with the students whether it would be better to have it be the total value of all 3 integrals instead of best of 3, but I think that makes the vertical stretch too powerful.)

That’s it! Let me know what you think. Materials below.

Slopes and Lattices Game

Okay, here’s a game I came up with off the cuff today. It kinda worked, but I guess if other people tried it and gave feedback, that’d be swell.

Players: 2 (or 2 teams), each with two colors

Board: A 10×10 grid.

The game is played in two phases. In the first phase, each team takes turns placing points on the grid, until each team has placed 5 points. The origin always is claimed as a neutral point. Every point has to be on a lattice point. (In the example below, I was blue and my student was yellow.)

In the second phase, on their turn, each player may place a new lattice point and form a line with one of their original 5 points. If that line then passes through one (or more!) of the opponent’s original 5 points, those points are stricken. If one player can strike out all of the other player’s points first, they win. (If not, then whoever strikes out the most.)

There is one caveats to round 2 – when a line is drawn, determine the slope of that line and write it below. That slope can’t be used again.

Image
A game in progress. I was blue&red, and have struck out 4 of my student’s points. They were yellow&black and have struck out two of mine. It’s their turn.

After playing the first time, it became clear that much of the game came down to placing the points. If you could place one of your points so it was collinear with two of your opponents, you can strike them both with a single line. (But this only works if there is space for a 4th, alternate color point in phase 2 to form the line.) You also want to place your points defensively, with weird slopes that don’t pass through a lot of lattice points, to keep them safe. The second player definitely has an advantage when placing points, but the first player has an advantage when drawing lines, so I’m hoping those balance out.

Thoughts?

Remote Teaching Math Games

I love playing math games with my students, but it’s been hard with remote teaching because so many games require physical objects. I’ve been able to play a bunch using a shared whiteboard, but there’s a limit to how many work in that method. I just discovered http://playingcards.io, though, which is a platform for playing card games online with anyone. They have built in games, but you can customize your own. I’ve taken several from the #MTBoS and my own blog and made them.

To use these files, first create a custom room. Then enter edit mode:

In the Room Options Menu, you can import a file. So download the file you want from here and import it there and the game is ready to go. You can then share the room code with students, and you can even make multiple rooms for different groups of students and jump between them.

For each game, click the image to go to the original blog post, and the title for the pcio file.

Games

Factor Draft

Math Taboo

Fraction Catch

Trig War, Log War, Inverse Trig War

Integer Deck

This last one isn’t a game so much as a resource for many other math games. It’s an integer deck, consisting of cards from -12 to 12 of each suit (and an extra 0 for each.) I colored the suits using a colorblind-friendly color palette, on top of the symbols. You can easily edit the deck (enter edit mode, then click on the deck) to remove cards from the deck or change the particular cards. It can be used for a lot of games – and helps avoid the problem of kids wondering what J, Q, and K mean. It would be a good deck to use for, say, Fighting for the Center or these Integer Games.

Name That Solution

I was reviewing solving equations for my SAT Math class. It’s a tricky thing to do because “equations” includes linear, systems, quadratic, and exponential equations. A lot of different skills to go over in a short amount of time.

After working through the requisite problems, I wanted a little more practice, so I came up with a game that they could play, based on the Bid-a-Note sections of the old “Name That Tune” game shows. I called it Name That Solution. Gameplay goes like this:

  • Start over with a simple equation, like “x = 2.”
  • Each turn, a team can change the equation in one way to make it more complex. (For example, make it “x + 3 = 2” or “5x = 2”.) Only one operation and one term can be added at most per turn. The team finished by saying “I can name the solution of that equation.”
  • On a team’s turn, they may challenge the other team to, in fact, actually solve it. (“Go ahead! Prove it!”) If the challenged team can, in fact, solve the equation, they earn a point. If not, the challenging team gets a point.
  • First team to 5 points wins.

20161021_094828_hdr

They played on whiteboards so they can change the equations quickly. The students quickly learned to not overextend themselves when making the equations harder, lest they find themselves challenged. So it leads to a nice exercise of constantly mentally making sure you know the steps to solve something before you take your turn, getting a lot of practice.

At the end of one of the classes, I did a big class-wide version, half the class versus the other half. But they wound up being very conservative, with neither team challenging the other and only take moves they knew they could solve. Which I guess was the point.

20161025_101227_hdr

That final round.

 

 

Crossing the Transverse

Oh my god, I haven’t blogged since August! This has been a hell of a year, let me tell you. But maybe I’ll tell you in another post, because this one is about the new game I made in my Geometry class. (My first non-Algebra game!)

So the game is called Crossing the Transverse. The goal of the game (pedagogically) is to help identify the pairs of angles formed by lines cut by a transversal, even in the most complex of diagrams. The goal of the game (play-wise) is to capture your enemy’s flagship.

Here’s the gameboard:

Crossing the Transverse Map

I printed out the board in fourths, on four different pieces of card stocked, and taped them together to make a nice quad-fold board. Then I made the fleet of ships out of centimeter cubes I had, by writing in permanent marker on the pieces the letter for each ship.

Quad Fold Board

Here’s the rules.

In the game, each type of ship moves a different way, which makes it feel a lot like chess – trying to lay a trap for the enemy flagship without being captured yourself.  Many of my students really enjoyed it when we played it yesterday. Today, though, to solidify, I followed up with this worksheet where they had to analyze the angles of a diagram much like on the game board. They did pretty well on it, so I’m satisfied!

Materials

Crossing the Transverse Rules

Printable Map (Prints on 4 pages)

No Stars Printable Map (If printing the background galaxy is not for you, here’s a more barebones version.)

Zip File with Everything, including Pages, Doc, and GGB files