views:

278

answers:

4

A user has to complete ten steps to achieve a desired result. The ten steps can be completed in any order.

If there is a bug, the bug is dependent only on the steps that have been taken, not the order in which they were taken (i.e., the bug is path independent). For example: If the user performs three steps in the order 10, 1, 2 and produces a bug the exact same bug will be produced if the user performs the same three steps in the order 1, 2, 10.

What is the maximum number of unique bugs this program can have?

A: 

One, a designer fault? :)

Cleiton
+1 for humor......
scunliffe
+4  A: 

You mean what is the number of distinct sets pickable from 10 elements? That's a powerset: 2**10.

hughdbrown
lol, this counts the bug that happens when the user doesn't do anything.
Anton Geraschenko
Very nice, Hugh. You are fast and good. One quick observation: Your blog does not appear to have any biographical information and you have such a common name that googling you is tough. Given that you have your pic in your SO profile and a blog, I assume that you want to be found so you may want to address this.
@Anton he he. Do you prefer 2^10 - 1?
The null set bug {} - I've seen this one many times on my mother's machine. You can just sit in front of it and see all kindsa crap go wrong with it.
xanadont
+4  A: 

hughdbrown's answer is correct, but there is another possible interpretation of the question. Suppose that a sequence of operations can never produce more than one bug (i.e. that it should just be counted as one bug). For example, if the operations (3,6,2) is a bug, then you shouldn't be allowed to count (3,6,2,5) as another bug. In that case, rather than finding the maximum possible number of subsets of {1,2,...,10}, you want to find the maximum number of possible subsets so that no one contains another. The answer to this version of the question is "10 choose 5"=252.

Edit: by the way, the result that says this is maximal is called Sperner's Theorem.

Anton Geraschenko
hughdbrown
@hughdbrown: are you spying on me? ... I checked my answer to make sure I wasn't making an arithmetic error with http://www.google.com/search?q=10+choose+5
Anton Geraschenko
Gentlemen, Wolfram Alpha is sooo much prettier: http://www.wolframalpha.com/input/?i=10+choose+5 Please do get with the program. WolframAlpha >> Google for math, at least.
hughdbrown
A: 

It depends entirely how many ways there are of doing each step. If you have a process that involves only one step, but there are multiple ways of doing that step, every step could have an associated bug.

There's also the misuse of functions, which you cant prevent against, which could be considered a bug. ie:

If a user was to think that

rm  -rf /

was short for

remove media --really fast /

ie: eject all devices1

I would guess that would be a potential bug. Its user error really, but its still a singular thing that can occur that produces results other than that were wanted.

You could argue the above is a bit over the top, but ultimately, there is no limitation on the ways users can do things wrong.

When users are there, assume, anything that can go wrong, will.

The only problem with the above reasoning, is you have to prematurely delete powerful things so users don't hurt themselves, which leads to less effective tools for those who know how to use them. Like corks on forks sort of rationale.

The only way to solve this concern effectively is give newbs blunt objects to learn with, and then give them an option which takes away all the foam padding once they learn the ropes, so experienced users don't have to keep working with blunt tools, and don't have to deblunten every tool themself.

( If there are infinite numbers of possibly ways to do 1 step, I don't even want to begin to think of the numbers of ways to do 10 steps wrong )

1: If you don't know, this will erase lots of your hard drive and cause much pain. Don't do it.

Kent Fredric
Huh? Color me confused. :) xo
You stated "User". Users can cause errors well outside control of the system, like turning the power off mid-phase. If you stated an autonomous process you control, then it depends entirely on the number of forks that can occur at any step. Your question does not state that steps are only /possible/ to occur in that order or not, if you can't control the order of the steps, and at each step, there is only one choice, then capacity for bugs is very very low.
Kent Fredric