Tag Archives: math

Number Sense Game

I programmed a new game recently!  And it’s even more fun than Pokemon Go!  Well, okay, fine, it’s only sort of a game.  It ultimately requires you to do mental math, so the web app itself isn’t much of a game.  The web app is more about displaying interesting data:

Number Sense Graph

Here’s the game:  using each of the four digits at the top once, your goal is to construct an expression that evaluates to an integer between 1 and 20 via any combination of basic math operators.  So, for example, given the digits 1 2 3 4, one possible expression that evaluates to 9 is: 4 * (2 + 1) – 3.

This is based on a game that Magoosh recommends its students play as they study for the GMAT/GRE in order to strengthen their math instincts.  It seemed like a fun puzzle to solve, so I worked on it and found the results to be pretty interesting!

The program calculates all the possible solutions for each integer using the four digits, displays the total number of them in a bar graph (plus, it’s animated!), and you can also see a list of all the solutions when you click on any of the bars.  Give it a try here: Number Sense!

 

Advertisements

Leave a comment

Filed under Game Development

Super Sevens for Android Shuffled into the Amazon Appstore

Super Sevens by Jeffrey Derrenberger (ThumbSnail Studios) is now available for Android exclusively at the Amazon Appstore for $1.99!

Download Super Sevens for Android on the Amazon Appstore
Fun fact:  “Super Sevens” has more than 7 to the 7 possible game configurations.  That’s 7 x 7 x 7 x 7 x7 x 7 x 7.  That’s a lot of sevens.

But wait, isn’t Sevens just a fun and simple game for kids?  Well, that’s true.  It’s a card game based on building a sequence up or down the seven of a suit.  It’s a great way to teach young children how to count.  But counting up from 7 to 13 or down from 7 to 1 isn’t exactly exciting math.  And certainly not the kind of math that would lead to so many sevens.

That's a lot of Sevens
Enter “Super Sevens,” the card game where you don’t have to play with a standard 52-card deck.  You can play with up to 10 different suits.  You can have up to 19 cards in a suit.  You can also play against up to 9 different opponents.  So let’s do some more interesting math to illustrate a more interesting game!

Up to 10 Different Suits in Super Sevens
Suits:  You can play with as few as 2 suits or as many as 10.  That’s a total of 9 different game types.

Sequence:  You can, of course, still play with a 7 as your midpoint card for the standard ace through king game.  Or you can play with a midpoint as low as 2 or as high as 10 (for ace through 19).  That’s 9 more different game types.  9 choices for the midpoint x 9 choices for the number of suits yields 81 different game types.  So now we’re using multiplication.

Super Sevens with 10 as Midpoint
Players:  A typical game of Sevens has 4 players.  In Super Sevens, you can have as few as 2 players or as many as 10.  So that’s a choice of 9 for the midpoint, a choice of 9 for the suits, and a choice of 9 for the players.  So now we’re using exponents.  9^3 is 729 game types.

Hearts-Style:  But 9^3 is a long way away from 7^7.  That’s alright, though, because Super Sevens also includes the option of playing in Hearts-Style, a mode where you try to survive several rounds of Sevens while having fewer passes than your opponents.  This toggle option means we have 729 x 2 = 1,458 game types.

Super Sevens Hearts-Style Mode
Double Deck:  You can also face an entirely different strategy by playing with a double deck.  This option is available for games with 2 to 5 suits.  Thus… Uh oh, now we’re on to permutations with repetition allowed!  4 possible choices for suits x 9 choices for the midpoint x 9 choices for the number of players is 324.  The total is now 1,782.

Super Sevens with Double Deck and 5 Suits
Double Deck Hearts-Style:  And for the greatest challenge of them all, you can play in Hearts-Style mode while using a double deck!  So that’s another 324, bringing the total to 2,106.

But you’re probably thinking, “Hey, 2,106 is nowhere near 7 to the 7.  7 to the 7 is 823,543.  That’s not even close!  What’s the deal with this ThumbSnail guy?  I thought snails were smarter than that.”  Well, there’s one other great feature about Super Sevens:

7 Different A.I. Difficulties:  The computer opponents in this app can have one of 7 personality types, ranging from “The Friendly” to “The Merciless,” depending on whether you feel like playing a more relaxed game or a more challenging one.  You can set all of your opponents to one personality type, or you can set each opponent individually to whatever personality you choose.

Super Sevens Can Have 10 Players
Thus, when you’re setting up a Custom game, you have a choice of 9 for the midpoint, a choice of 9 for the suits, a choice of 9 for the players… and a choice of 7 for each of the number of players’ personality types.  That’s, um, a, uh… combination with repetition allowed within a permutation with repetition allowed?  I… think?

Now, admittedly, this is beyond my mathematical ability, and I can’t wrap my brain around how to answer this.  However, the equation for a combination with repetition (scrolling down to the bottom of that page) appears to be:  (n + r – 1)! / r! * (n – 1) !, where n is the number of things to choose from and r is how many we choose.  And now we’re using factorials!

I have no idea how to calculate this for every possible game type in Super Sevens.  However, let’s just look at the number of combinations for a single game type:  a game with 10 suits, 10 as the midpoint, and 10 players.  The variable r is 9 since we are selecting the personality for a total of 9 opponents.  The variable n is 8 (since there are 7 possible AI personalities plus we can also play against another type of opponent:  a human in the same room on the same mobile device).  Plugging those values in, we get:

(8 + 9 – 1)!/9!*(8 – 1)! = 16!/9!*7! = 11,440

11,440 is the number of combinations for a game with 9 opponents who each have a personality of 8 possible types.  And that was just for one possible game type for 10 players.  Since you have 9 choices for the midpoint and 9 choices for the suit, there are 81 possible game types with 9 opponents.

81 * 11,440 = 926,640

926,640 is greater than 823,543.  That’s not even including Double Deck mode or Hearts-Style mode or Hearts-Style Double Deck mode.  That also doesn’t include games with less than 10 players.  So I don’t know what the complete answer is for the total number of game configurations in Super Sevens, but it’s more than 7 to the 7.

Super Sevens Random Mode - Easy
Whew, wow, thank goodness there’s Random mode where the game can just decide all of this stuff for me.  My brain hurts.  Tonight, I’m playing on easy!

Super Sevens for Android requires at least Android 2.3.3

Leave a comment

Filed under Super Sevens