45

A few days back I didn't understand Fibonacci encoding and I asked a question about it that was downvoted. It has since been closed and deleted, so here is the full text:

Building fibonacci coding

Can someone explain how you turn a number into a Fibonacci code without any programming code? Similar questions I've found either link papers I do not understand or obfuscate my understanding by being a code implementation.

I understand that you can write any number as a sum of non adjacent Fibonacci numbers. Zeckendorf's theorem So 1, 2, 3, 1 + 3, 5, 1 + 5, ... But how do I get the Fibonacci code word from this.

1      11
2     011
3    0011
4    1011

Just binary adding 1+3 gives 11+0011=0110. Any explanation would be appreciated.


The Help Center notes:

We feel the best Stack Overflow questions have a bit of source code in them, but if your question generally covers…

  • a specific programming problem, or
  • a software algorithm, or
  • software tools commonly used by programmers; and is
  • a practical, answerable problem that is unique to software development

… then you’re in the right place to ask your question!

I indeed didn't include code, but I felt like my problem of understanding was before the implementation and the problem was software related, shared with math.

I'm not sure if this is the same as "Is asking for an explanation of some code on-topic?" because there it was a question after code was received

I decided to ask this clarification because I found this excellent explanation of a suffix tree that didn't involve any code.

The question I referred to may be off-topic as IMO it overlaps between math and programming, but I'm asking if I in general can ask about how an algorithm works without just asking for a code implementation.

10
  • 22
    Your question is about math only, and thus, it's off-topic.
    – ForceBru
    Commented Jan 31, 2017 at 19:10
  • 2
    It may also have been downvoted due to "lack of research", since you don't mention having read the Wikipedia article... Commented Jan 31, 2017 at 19:12
  • "Lack of research" is a fair point even tough I had read the wikipedia article. Would it have been okay if I gave a link to the wikipedia article and the construction method mentioned there? Isn't it a topic shared by math and programming?
    – turoni
    Commented Jan 31, 2017 at 19:17
  • 2
    It just feels unfair to be downvoted for this. I tried to do my fair share of answering questions and improving answers with fairly little return so any downvote on a question I feel like I put thought and work into feels like a personal attack.
    – turoni
    Commented Jan 31, 2017 at 19:46
  • 34
    That's a problem. People are not attacking anything. They are voting on the content and its usefulness to them and (ideally) to the programming population at large. Since there is no code involved, it likely will not have as much use for programmers as is. See also meta.stackexchange.com/a/165521/194720 for other sites which may be more appropriate. Note that "Programmers SE" is now Software Engineering. Commented Jan 31, 2017 at 19:51
  • 5
    " and is a practical, answerable problem that is unique to software development" <-- the most important item of that list. That condition is necessary for any question to be on topic. BTW, why it has to be asked on SO?
    – Braiam
    Commented Jan 31, 2017 at 22:31
  • 2
    In the future, I suggest that you tag similar questions with the algorithm tag, and leave the math tag off. By tagging only with the math tag, and then excluding code-based answers, you pretty much guaranteed that people would insist that your question should be on the math stack exchange. Commented Feb 2, 2017 at 3:50
  • 1
    @ForceBru Not only programming, but everything related to computers world is tightly linked to and ruled by maths Commented Feb 3, 2017 at 6:18
  • 2
    @BillalBEGUERADJ, I agree, but questions about math and only math are still off-topic because there's Mathematics.
    – ForceBru
    Commented Feb 3, 2017 at 17:49

2 Answers 2

48

It is perfectly okay to ask algorithms questions here on Stack Overflow. It is also okay if your question does not contain any code.

However, your question specifically requests that the answers not contain any code, which is…a bit odd for a programming Q&A site. It certainly makes it look like you're asking a pure mathematics question instead, which would (A) be off-topic for Stack Overflow, and (B) possibly be more appropriate on a Mathematics Q&A site. Here, you need to be asking about algorithms in the context of computer programming; in fact, you should be asking about them in the context of a specific, practical programming problem.

More generally, as others have said, it undeniably improves the quality and reception of your question if you indicate that you have done some background research and have a general understanding of the topic you're asking about. Otherwise, you run the risk of having your question closed as "too broad", since the answer would have to be the length of a textbook (or at least a chapter in a textbook) in order to teach you what you need to know.

"Give me teh codez" questions are not going to be well-received here, and neither are variations on that form, such as "give me teh algorithmz".

On Stack Overflow, it works better to ask about specific portions of an algorithm that you don't understand, aren't sure how to transform into code, or are having problems with in code that you have written. If you have no idea how the algorithm works and are seeking a general explanation, then your question is probably both "too broad" and "off topic".


Had your original question included the follow-up question that you (for some unknown reason) posted as an answer, it would have made the question much better. At least, it would have provided more context for the question and narrowed the scope slightly, which would have at least solved the "too broad" problem. It would still be arguable whether it was a pure mathematics question, and therefore whether or not it was on topic, but it would have been at least less likely to be closed. Admittedly, this is a bit of a gray area, and different subpopulations of our membership disagree on exactly how topical general algorithms questions are. By asking a good question, you considerably improve your odds of people letting it slide.

3
  • Perhaps OP's question would be more suitable for the Software Engineering Site?
    – Chris
    Commented Feb 3, 2017 at 10:57
  • 3
    I wouldn't know, @Chris. I am not a regular participant on that site. You would have to look at their Help Center to see what is on topic. Doesn't look like it to me. Better places to investigate would be Mathematics or Computer Science. Again, be sure to check what is on topic there before posting.
    – Cody Gray Mod
    Commented Feb 3, 2017 at 10:58
  • 1
    Yeah, nor am I. Just thinking aloud I guess. Though you're probably right, CS seems more relevant.
    – Chris
    Commented Feb 3, 2017 at 11:00
10

I've gone both ways with such questions. The features I want to see (personal opinion) include

  • OP (Original Poster: you) performed due diligence to research the problem.
  • The question restricts the desired explanation to a particular aspect of the algorithm.
  • Understanding the algorithm is directly useful for programmers; it helps if OP states the programming applications.

I admit that I don't align with the community on every example, but I feel that I have an appreciable "accurate" record on this.

In your case, I expect I would have down-voted because I don't see that you've used the readily available resources on the topic, such as the brief, 4-step description on the Wikipedia page. Had you said, "I follow the process this far (giving detail and a link), but then I don't understand how to get the remaining digits.", then I'd be happy to read the link myself and explain the rest.

In retrospect, we can also see that some people misunderstood your "without any programming" phrase. You meant that the explanation shouldn't include coding.

Does any of this help? If the other explanations in the comments didn't answer your question, I would like to see it clarified and resubmitted.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .