Code Monkey home page Code Monkey logo

my-hello-world-first-code-'s Introduction

Seperating kids from fighting

Now this wasn't a problem in itself, except for the fact that I had 2 kids in the same class that used to fight like every day. Each kid would enter the class in a neutral state. After the first circuit I have them swim, the order gets changed so that no kid sits by the same pair of kids again when I have them line against a wall as opposed to swimming a circuit around me. The kids who only have 1 neighbor treat that arrangement as ok if that one neighbor has appeared in a neighbor pair of students but not if they individually sat next to that persons on the edges before.
The question I had was simple. How many laps would a group of N students be able to swim before at least one student was no longer able to find neighbors that they had not been seated around before? What was the permutation set of the students that satisfied this condition first from the original arrangement? How does 16 yr old me find out what question to ask my teachers and later my college professors? Why did I spend 3 years thinking about this only to wait a year before I post my solution?

The way I imagined the students was at first a set of legos that all had different colors and then later as unique prime numbers. Before I learned any programming, how did I test my hypotheses for laps with N students against idealized objects? The answer is surprisingly LAME!!! I did it all on paper and pretended they were actually colored blocks and tried to find patterns which would always produce a new lap in the finite block set (see images). I tried everything from breaking things up into groups of 3 and trying to find all the symmetrical combinations of patterns like moving every other block in a circular way but keeping the ones not moved in the same position. I then just went with trying to multiply the amount of these checkered squares with the number of ways I could find to move the blocks so that they skipped one or two blocks but symmetrically across the line. This was a first guess, and I was wrong. Then I tried something I had learned a year earlier to try to apply math to Yugioh (dont ask) -- n choose k. Maybe since I knew that there couldn't possibly be more than (N)(N-1)/2 solutions since there were essentially 2 choices you had (either on the edge or not) and because I knew that since both kids on the ends would essentially share 1 neighbor (the water) I thought there would be a general equation for N. After asking my teachers for a bit and trying reallyyyyy hard to find a general equation, I instead found a solution. Not because I surprisingly couldn't match the sequence of numbers I found in the OEIS (Online Encyclopedia of Integer Sequences), but because I learned to communicate to others who share my love for math. I never did find a general equation for the problem but I dedicate my first github source code to this random string generator problem that I created a notebook graveyard for over the years :)

number sequence is looking for a general equation to this problem 1,1,3,4,8,15,22..

my-hello-world-first-code-'s People

Contributors

nilogregginz33 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.