-18

I am a non-English speaker who is new to Stack Overflow. I recently read how to ask good questions and started asking questions to Stack Overflow. Sadly, I got an answer that my question was off the topic and the question was closed. Suddenly I can't upload a question post to Stack Overflow. I thought you could help me with these challenges in the Stack Overflow Meta, so I posted it.

The reason my question was closed is that it wasn't related to programming. However, I’m not very familiar with the scope of what is considered programming. Also, my question is related to Python’s numpy.

Please check if there was a mistranslation in my question that might have caused people to misunderstand my intent or if there were other violations. With your help, I can learn programming. (This is a translation using a translation tool.)

Here are the links. I asked the second question to make up for the lack of the first question.

  1. How can I get the expected results when I run numpy.random.randint?

  2. https://stackoverflow.com/questions/78864980/how-do-you-prove-the-proposition-that-the-general-inverse-function-of-numpy-rand

18
  • 4
    Don't jump in to asking questions. Take time first to follow the tags you're interested in, see what gets closed and what gets up voted and/or answered, to get a feel for what the expectations and standards are.
    – Shawn
    Commented Aug 14 at 3:37
  • 6
    In the first question, I can't understand why you expect a specific result. Just to make sure, since you mentioned difficulty with English: do you understand the word "random"? What do you believe is the purpose of numpy.random.randint? Commented Aug 14 at 3:52
  • 8
    Your closed question is more like a request for community users to provide proof of a premise you have intuited about Numpy's PRNG without, apparently, investigating Numpy's source code and analyzing the PRNGs used by that library and how they are used. And even if you had done the hard work and come up with a specific question, perhaps it would still be a mathematical question and not a programming one. Commented Aug 14 at 4:01
  • 3
    The first question isn't really off-topic but rather is a duplicate. "How do I get the same result when using numpy.random" is already answered as "use the same seed". "How do I get the seed given some random results" is a much more broader question given the fact that the algorithm to generate those is deliberately made so that figuring out such stuff is difficult. Commented Aug 14 at 4:09
  • @Karl Knechtel I learned that, contrary to the linguistic notion of "random," scientifically, "random" is a concept that cannot truly exist. I learned from Newtonian mechanics that everything that happens in the future can be calculated. I also learned that the concept of "purpose" cannot be clearly defined; it is an ambiguous concept created in the human brain through evolutionary processes. Commented Aug 14 at 4:20
  • @Karl Knechtel To sum up, I wanted to understand the functioning of a program by expressing the procedures defined as random in Numpy through fundamental programming constructs (e.g., loops, conditionals, arithmetic operations) rather than through the ambiguous linguistic expressions. Commented Aug 14 at 4:20
  • 9
    @codebetatester "I wanted to understand the functioning of a program by expressing the procedures defined as random in Numpy through fundamental programming constructs" the solution for that is to actually look at the code for Numpy rather than trying to guess from it's behaviour and that isn't the question you've asked in either of the two linked questions. Commented Aug 14 at 4:25
  • @Abdul Aziz Barkat Is there a way to print the numpy code without inferring its function from the results? Commented Aug 14 at 4:44
  • 7
    @codebetatester if you ask questions like this without putting in proper research, your questions won't be very well received on this site. A quick search would have given you where to get Numpy's code since it is open source and accessible on this GitHub repository. Please research before asking. Commented Aug 14 at 4:49
  • @AbdulAzizBarkat, I've already presented this link to the user here before. He didn't make a point of opening the link before, why would he click it now? Commented Aug 14 at 4:54
  • 5
    @codebetatester That GitHub repository has Numpy's code (mostly Python and C) since you want to "understand the functioning of ... Numpy through fundamental programming constructs" this repo is where you'd find those programming constructs, I wouldn't be able to help you much since I've never read Numpy's code myself, you can probably begin by looking at the directory of the sub-package you're interested in and trying to figure out the code as you want to. Commented Aug 14 at 5:04
  • 2
    Ok, just click here. This link will take you to Numpy random source code folder. Any one of these sub-folders contains the source codes for the Numpy's PRNGs. Commented Aug 14 at 5:07
  • 1
    While you've been claiming otherwise, I still find that your fundamental issue is misconception of PRNG. Do you understand what a PRNG is and how a typical PRNG is implemented (and used)? If that is the case, you probably won't comment in an answer to your question that you want to reverse engineer the seed from the random number series. Commented Aug 14 at 6:10
  • 2
    If you are interested in the internal working about PRNG, read about the general algorithms first. There are a lot of materials on the Internet on this topic. Read them and make sure you understand them before moving to actual implementation in numpy. Without the proper background knowledge it is impossible to understand what is happening by just looking at numpy source code. Also you are too obsessed with reproducing some result. It's not helpful in this case. As for your edit about inability to post questions, see this Commented Aug 14 at 6:33
  • 1
    Doesn't this answer your question? Commented Aug 14 at 7:23

0

You must log in to answer this question.

Browse other questions tagged .