We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Loading...
  • Practice
  • Compete
  • Jobs
  • Leaderboard
  • Hiring developers?
  1. All Contests
  2. ProjectEuler+
  3. Project Euler #100: Arranged probability
  4. Discussions

Project Euler #100: Arranged probability

  • Problem
  • Submissions
  • Leaderboard
  • Discussions

Sort 7 Discussions, By:

votes
  • recency
  • votes

Please Login in order to post a comment

  • georeth2010 2 years ago+ 0 comments

    Page 176-178 of "Quadratic Diophantine Equations" by Titu Andreescu, Dorin Andrica.

    (IMHO, this is a meaningless problem)

    1|
    Permalink
  • jamespate 3 years ago+ 0 comments

    The case P/Q = 1/2 like the real Project Euler Problem 100 is very easy to solve once you are able to look up the sequence: 1, 3, 15, 85, 493, 2871, 16731,... It turns out to be Sloane's integer sequence https://oeis.org/A011900 which has a nice and easy recurrence of a(n) = 6*a(n-1) - a(n-2) - 2 with a(0) = 1, a(1) = 3.

    1|
    Permalink
  • satyajeet753 12 months ago+ 0 comments

    why this can't be solved using binary search

    0|
    Permalink
  • kitchent 2 years ago+ 0 comments

    Does anyone knows whether Brahmagupta's composition is applicable here or not? I'm stuck with not being able to generate 85 120 from 3 4 and 15 21.

    Even completing squares to arrive at Pell's equation with integer is troublesome with like 3 8. No clue yet.

    EDIT: It gets frustrating. This time I follow the continued fraction approach. The trouble is still at the very beginning. While now I know that as a perfect square should result in No solution, I could not get the Pell's Equation in its appropriate form. The one I've got is , where . So now it is . But when I plug in with and for the case and , those and are not integers. The fact is that, I couldn't even get the fundamental solutions for and right.

    Is it possible that there are multiple valid Pell's Equations for one input? But then there would be infinitely many such equations as I could just modify the corresponding . This idea sounds horrifying. And when sqrt is involved, answers like 181489708628619 296371453137673 is found for 3 8 1000, which is obviously wrong.

    Also, there is the issue with OverflowError: long int too large to convert to float for Test Case #11, #16 and #17, when I tried to perform y * sqrt(k) + 1.

    Trying to implement something like the Generic two integer variable equation solver is too overwhelming.

    EDIT 2: Just found this, this, this, and this. That's a lot of reading ahead of me.

    0|
    Permalink
  • cantonios 4 years ago+ 0 comments

    Hmm... is there an approach that doesn't require implementing a full quadratic diophantine solver? Mine has gotten extremely complex, and is starting to time out.

    0|
    Permalink
  • ykrmeena 4 years ago+ 1 comment

    I am solved complete problem but having only problem with Scanner to take input.can you suggest me what can i do for take input via scanner or oter way.

    -1|
    Permalink
    • zack_kenyonAsked to answer 4 years ago+ 0 comments
      Endorsed by ykrmeena

      Scanner is what, java? All data is passed to the program via STDIN. you can check the hackerrank tutorial for java problems though if that's not enough.

      -1|
      ParentPermalink
  • Vignesh201293 4 years ago+ 1 comment

    Can anyone elaborate the question more thank you

    -8|
    Permalink
    • ykrmeena 4 years ago+ 0 comments

      their are problem to find how many blue disk having in total disk which have followed ratio of p/q :that you enter. d+1 is minimum no. of disk .Now you can solve......

      -2|
      ParentPermalink

No more comments

Need Help?


View top submissions
  • Contest Calendar
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy
  • Request a Feature