christianp,
@christianp@mathstodon.xyz avatar

Here's a game inspired by @two_star's "reverse the list of integers" game.

Get from one integer to another by a sequence of moves. Valid moves are:

  • EXPAND: replace a number with an equivalent mathematical expression, e.g. 5 → 1+4
  • EVALUATE: replace an expression with its numerical value, e.g. 1+4 → 5.
  • SWAP: swap a mathematical operation for another one, e.g. 1+4 → 1×4.

I'll put an example game in the next toot

alejandrogil,

@christianp @two_star What about going from a to b, where a and b are rational numbers (not sure it would work for real numbers)?

For example, from 0 to 1/2
Expand: 0 = 1 + 1-2
Swap: 1 + 1 - 2 >>> 1 - 1/2
Evaluate: 1 - 1/2 = 1/2

For real numbers, if more operations are allowed then, from example, from 0 to sqrt(2):
Convert 0 to 1/2 like previously shown
Expand: 1/2 = 1+1 - 2+(1/2)
Swap: 1+1 - 2 + (1/2) = 1-1 + 2^(1/2)
Evaluate: 1-1 + 2^(1/2) = sqrt(2)

What about going from 0 to pi, e and other numbers? Maybe allowing certain operations it would fork.

Also, if it is possible to go from a to b, then it may be done in only one iteration of expand - swap - evaluate. For example, from 0 to sqrt(2) in one step

Expand: 0 = 1+1 - 2 + (1+1-2)
Swap: 1 - 1 + 2^(1-(1/2))
Evaluate: sqrt(2)

Notice that I have just composed 0 to 1/2 and 1/2 to sqrt(2) in one step. So if we can demostrate that there is a way to go from a real to b real, it means that every real number has a equivalent formula in which we can replace the operation of it to obtain another real number we want. And that is a pretty nice theorem :)

christianp,
@christianp@mathstodon.xyz avatar

Start at 5, get to 7.

5
1 + 4 expand 5
1 + (1 + 3) expand 4
1 + ((1×1) + 3) expand 1
1 + ((1+1) + 3) swap × with +
1 + (2 + 3) evaluate 1+1
1 + (2 × 3) swap + with ×
1 + 6 evaluate 2 × 3
7 evaluate 1 + 6

christianp,
@christianp@mathstodon.xyz avatar

What questions can I ask about this game?

I'm happy that you can get from any integer to any other integer, without thinking too hard about how to do that in detail.

I'm also happy that any game can be arbitrarily long, both in number of moves and length of the expression at any point in time.

Is there a constraint I could add that would make the previous statements sometimes false?

If I looked at shortest sequences of moves between two integers, would I find anything surprising?

Is it true that shortest(a,b) = shortest(b,a) for all a,b? I think so: given a sequence from a to b, reverse the order of moves and swap "expand" and "evaluate", and you get a valid path from b to a.

Would that be fun to formalise? Could I do it without saying what "a valid mathematical expression" means?

RobertJackson58585858,
@RobertJackson58585858@masto.ai avatar

@christianp

?going back requires -ve. So, a restriction to natural numbers ... ?

christianp,
@christianp@mathstodon.xyz avatar

@RobertJackson58585858 are you sure about that? I can make 7 smaller just by swapping × for +:

7
Expand: 1 + 6
Expand: 1 + (2 × 3)
Swap: 1 + (2 + 3)
Evaluate: 6

christianp,
@christianp@mathstodon.xyz avatar

@RobertJackson58585858 or, even shorter:

7
Expand: 1 + 6
Swap: 1 × 6
Evaluate: 6

RobertJackson58585858,
@RobertJackson58585858@masto.ai avatar

@christianp

This is really cool :))

RobertJackson58585858,
@RobertJackson58585858@masto.ai avatar

@christianp

Ahah!!

So can restrict to natural numbers :)

jcastroarnaud,

@christianp You should define "valid mathematical expression" better. Is division allowed? Is integer division allowed? Are negative integers allowed? Can one uses factorial, or other non-alphabetic operator?

A short sequence from n from/to n + 1, for every integer n, is:

n
n + 0
n + (1 - 1)
n + (1 * 1)
n + 1

Are these moves valid?

a + (b * c)
(a + b) * c
(a + c) * b
(a * c) + b

christianp,
@christianp@mathstodon.xyz avatar

@jcastroarnaud I'm really interested in seeing how different definitions of "valid mathematical expression" change the game

christianp,
@christianp@mathstodon.xyz avatar

@jcastroarnaud for example, I think that under a certain reasonable definition, the following is the shortest route from a to b for any a and b:
Square brackets mean "the number equivalent to the contained expression"

a
expand: b + ([a - b] + 0)
swap: b + ([a - b] × 0)
evaluate: b

Colinvparker,
@Colinvparker@mathstodon.xyz avatar

@christianp @jcastroarnaud In a very restrictive form of the game:

  1. Only positive integers, addition, and multiplication are permitted
  2. Multiplication by 1 (which is trivial) is disallowed

I believe that in this case 1,2,3, and 4 are in unique single element equivalence classes. 5 and higher integers are in an equivalence class via the relation (2+3)->(2*3), iterated as needed. The shortest move between higher numbers becomes a bit tricky to calculate?

christianp,
@christianp@mathstodon.xyz avatar

@Colinvparker @jcastroarnaud am I allowed to get multiplication by 1 from swapping 1+1 to 1×1?

christianp,
@christianp@mathstodon.xyz avatar

@Colinvparker @jcastroarnaud e.g.

4
expand: 1 + 1 + 1 + 1
swap: 1 × 1 + 1 + 1
evaluate: 3

Colinvparker,
@Colinvparker@mathstodon.xyz avatar

@christianp @Colinvparker @jcastroarnaud No, in my restriction I’ve forbidden operation swap when any of the arguments is 1. But that may not even be enough to make finding a path hard, as I said in the next toot.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • DreamBathrooms
  • ngwrru68w68
  • tester
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • InstantRegret
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • mdbf
  • tacticalgear
  • JUstTest
  • osvaldo12
  • normalnudes
  • cubers
  • cisconetworking
  • everett
  • GTA5RPClips
  • ethstaker
  • Leos
  • anitta
  • modclub
  • megavids
  • provamag3
  • lostlight
  • All magazines