Solving Math Puzzles with data.tree

May 29, 2016

(This article was first published on R – ipub, and kindly contributed to R-bloggers)

I got a note from Karim Lahrichi, who even thinks about math when he’s supposed to be drinking beer. The bar puzzle they were trying to solve goes like this: Using all of the numbers 1, 3, 4, 6 exactly once, and any combination of: addition, subtraction, multiplication and division (and parenthesis to group operations however you like), arrive at the number: 24.

Sounds easy, right? Until you try to find the answer…

Luckily, he remembered the puzzle the next morning, and had a systematic go at it. He used data.tree to do a brute force solution. Read all about it on RPubs.

The post Solving Math Puzzles with data.tree appeared first on ipub.

To leave a comment for the author, please follow the link and comment on their blog: R – ipub. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)