Git Product home page Git Product logo

gears's Introduction

Gears problem :

The original problem was to produce a gear with 127 teeth by passing it through different combinations of gears. Each pass would use 2 gears, and at the end the machine that does this work always uses a gear with 40 teeth. You must choose combinations of gears that produce the closest result to 127 teeth, within the accepted range of error. If you were to use 2 pairs of gears this would create the mathematical formula :

(a / b) * (c / d) * 40 = 127

Using 3 pairs of gears you would have the formula :

(a / b) * (c / d) * (e / f) * 40 = 127

In the original real life scenario the gears in each pair must have between 13 and 50 teeth. The acceptable range of error is .0001.

Finding a solution :

Using a brute force algorithm it was discovered that using 2 pairs of gears (eg. (a / b) * (c / d)) the closest resulting number to 127 is not within the acceptable range of error.

(35/17) * (38/31) * (39/31) * 40 = 127.00006121074858

Using a similar brute force algorithm to find the closest match with 3 pairs of gears produced a number within the accepted range of error, however, the algorithm was extremely inefficient.

(a / b) * (c / d) * (e / f) * 40 = 127

Create an efficient algorithm to find the best combination of gears within the accepted range of error.

Useful tool :

Combinatorial math comes into play when trying to reduce a set. This tool is used to calculate number of combinations with repetition :

http://www.calculatorsoup.com/calculators/discretemathematics/combinationsreplacement.php

gears's People

Contributors

nameofname avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.