Welcome to the most active Linux Forum on the web.
 LinuxQuestions.org Tutorials and Templates
 User Name Remember Me? Password

Notices

Tutorials and Templates A collection of tutorials and templates of my own making.

New Years Data To DB - Arithmetic, Graphs and Relations

Posted 03-14-2019 at 04:58 PM by astrogeek
Updated 03-15-2019 at 12:14 PM by astrogeek (Forgot aggregate column)

... Or, How To Get From Arithmetic to Relational Algebra and Enjoy The Trip!

Quote:
Originally Posted by dogpatch
I found the 'NP Complete' link quite interesting, even though i still don't fully grasp the concept, nor your explanations about sets, etc.
I would very much like to try to explain some of the ideas of sets, how those are important to some aspects of our fun with the newyears puzzle, and why that takes us into the domains of graph theory and relational databases. In doing so, I do not pretend...
Moderator
Views 628 Comments 0

New Years Data To DB - The Model and The Data

Posted 03-12-2019 at 03:48 PM by astrogeek
Updated 03-12-2019 at 05:02 PM by astrogeek (typos)

With a now complete solution set and minimal set of generating expressions, it seems reasonable to think about inserting these into a relational database in order to more easily explore the landscape. To do so we need a normalized data model to query, and methods of capturing the data into the model or schema, both of which are easily within reach.

First, it is important to realize how many unique result sets there are, and how these are related to the ten thousand four digit "years"....
Attached Images
 newyear.gif (20.4 KB, 8 views)
Attached Files
 years_v1.1.0.tar.gz.txt (16.2 KB, 1 views)
Moderator
Views 639 Comments 2

New Years Data to DB - The Idea

Posted 02-28-2019 at 02:33 AM by astrogeek

The initial efforts of all participants in the newyears thread, and comparison and validation of the results produced by the three different approaches to the problem, have led us to agreement that we have indeed found a complete set of solutions. At least complete within the bounds of our combined ability to imagine and test generating expressions to this point!

Knowing what a complete solution set looks like, we have each shifted emphasis from the generating code, to a more critical...
Moderator
Views 504 Comments 0

New Years Puzzle, Fractional Math and More...

Posted 02-08-2019 at 02:10 AM by astrogeek
Updated 02-22-2019 at 04:43 PM by astrogeek (Reorganizing categories)

Updated 2/17: New code now available, minimal expression set, see below...

The continuing saga fo the New Years Puzzle and Programming Challenge.

Member Beryllos who originally opened the thread discovered that some solutions were missed (and possibly other invalid solutions included) as a result of math errors intrinsic to floating point math. They very correctly identified integer math, math using only integer fractions, as the necessary solution. In the face of some...
Attached Images
 ast1.png (25.5 KB, 9 views) ast2.png (19.5 KB, 12 views) years_vs_solns_complete_v1.0.2.png (21.2 KB, 5 views)
Attached Files
 years_minimal_v1.0.2.tar.gz.txt (71.9 KB, 3 views)
Moderator
Views 1047 Comments 0

New Year Puzzle

Posted 01-04-2019 at 07:43 PM by astrogeek
Updated 02-22-2019 at 04:41 PM by astrogeek (Reorganizing categories)

NOTE: See updates at bottom of this post - last 1/5/19

Way back around new year's day during the winter of '19 (remember that kiddies?), LQ member Beryllos posted a New Year Puzzle and programming challenge in the Programming forum.

The goal of the puzzle is to generate as many whole numbers as possible between 0 and 100 using only the digits of the year, 2,0,1 and 9 in simple constant arithmetic expressions such as 9 * (10 - 2).

The rules are simple,...
Moderator
Views 646 Comments 0

All times are GMT -5. The time now is 10:44 PM.

 Advertisement
 Advertisement
 My LQ
 Write for LQ LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
 Syndicate Latest Threads   LQ News Twitter: @linuxquestions Facebook: linuxquestions Google+: linuxquestions