Sunday, October 15, 2006
The correct answer is 2/3.Since one of the children is female, the
possible arrangements of children is {(male,female) ,(female, male),
(female,female) }. Among 3 of them, there are 2 arrangements that
gives the other child is male. So the probability of the other child
is male is 2/3
Whenever a product's development schedule is slipping badly and there is a crisis meeting of the programming team, the term "mythical man-month" is likely to be bandied about. There will be many sighs and exchanges of knowing looks and pointing of fingers and tasks assigned and subsequent exchanges of memoranda and Highly Significant Position Papers. But it's a safe bet that hardly anyone at the meeting will have actually read "The Mythical Man-Month" by Frederick P. Brooks Jr. or know exactly what it talks about -- the book, and its author, have acquired a certain mythic status of their own.
So what is a mythical man-month anyway? Consider a moderately complex software application from the early microcomputer era, such as the primordial version of Lotus 1-2-3, Ashton-Tate dBASE, or Wordstar. Assume that such a program might take one very smart, highly-motivated, expert programmer approximately a year to design, code, debug, and document. In other words, 12 man-months. Imagine that market pressures are such that we want to get the program finished in a month, rather than a year. What is the solution? You might say, "get 12 experienced coders, divide up the work, let them all flog away for one month, and the problem will be solved. It's still 12 man-months, right?"
Alas, time cannot be warped so easily. Dr. Brooks observed, while he was managing the development of Operating System/360 (OS/360) in the early 1960's, that man-months are not -- so to speak -- factorable, associative, or commutative. 1 programmer * 12 months does not equal 12 programmers * 1 month. The performance of programming teams, in other words, does not "scale" in a linear fashion any more than the performance of multi-processor computer systems. He found, in fact, that when you throw additional programmers at a project that is late, you are only likely to make it more late. The way to get a project back on schedule is to remove promised-but-not-yet-completed features, rather than multiplying worker bees.
When you stop to think about it, this phenomenon is easy to understand. There is an inescapable overhead to yoking up programmers in parallel. The members of the team must "waste time" attending meetings, drafting project plans, exchanging EMAIL, negotiating interfaces, enduring performance reviews, and so on. In any team of more than a few people, at least one member will be dedicated to "supervising" the others, while another member will be dedicated to housekeeping functions such as managing builds, updating Gantt charts, and coordinating everyone's calendar. At Microsoft, there will be at least one team member that just designs T-shirts for the rest of the team to wear. And as the team grows, there is a combinatorial explosion such that the percentage of effort devoted to communication and administration becomes larger and larger.
- Assigning more programmers to a project running behind schedule will make it even later, due to the time required for the new programmers to learn about the project, and the increased communications overhead. When N people have to communicate among themselves (without a hierarchy), as N increases, their output M decreases and can even become negative (i.e. the total work remaining at the end of a day is greater than the total work that had been remaining at the beginning of that day, such as when many bugs are created).
- Group Intercommunication Formula: n(n − 1) / 2
- Example: 50 developers -> 50(50 − 1) / 2 = 1225 units of effort (hour/week/month) spent in communication
- The Second-system effect
- The second system an engineer designs is the most dangerous system he will ever design, since it will be disastrously overdesigned. Thus, when embarking upon a new project, a project manager should ask for a chief architect who has designed at least two systems.
- Progress Tracking
- Question: How does a large software project get to be one year late? Answer: One day at a time! Incremental slippages on many fronts eventually accumulate to produce a large overall delay. Continued attention to meeting small individual milestones is required at each level of management.
- Conceptual Integrity
- In order to make a user-friendly system, the system must have conceptual integrity, which can only be achieved by separating architecture from implementation. A single chief architect (or a small number of architects), acting on the user's behalf, decides what goes in the system and what stays out. A "super cool" idea by someone may not be included if it does not fit seamlessly with the overall system design. In fact, to ensure a user-friendly system, a system may deliberately provide fewer features than it is capable of. The point is that if a system is too complicated to use, then many of its features will go unused because no one has the time to learn how to use them.
- The Manual
- What the chief architect produces are written specifications for the system in the form of the manual. It describes the external specifications of the system in detail, i.e., everything that the user sees. The manual can be altered as feedback comes in from the implementation teams and the users.
- The Pilot System
- When designing a new kind of system, a team will design a throw-away system (whether it intends to or not). This system acts as a pilot plant that will reveal techniques which will subsequently cause a complete redesign of the system. This second smarter system should be the one delivered to the customer, since delivery of the pilot system would cause nothing but agony to the customer, and possibly ruin the system's reputation and maybe even the company's.
- Formal Documents
- Every project manager must create a small core set of formal documents which acts as the roadmap as to what the project objectives are, how they are to be achieved, who is going to achieve them, when they are going to be achieved, and how much they are going to cost. These documents may also reveal inconsistencies that are otherwise hard to see.
- Project Estimation
- When estimating project times, it should be remembered that compilers are three times as hard to write as application programs. And systems programs are three times as hard to write as compilers. And the use of a suitable high-level language may dramatically improve programmer productivity. Also, it should be kept in mind how much of the work week will actually be spent on technical issues rather than administrative ones or other non-technical ones, such as meetings or sick leaves.
- Communication
- In order to avoid disaster, all the teams working on a project should remain in contact with each other in as many ways as possible (e-mail, phone, meetings, memos etc.) Instead of assuming something, the implementer should instead ask the architects to clarify their intent on a feature he is implementing, before proceeding with an assumption that might very well be completely incorrect.
- The Surgical Team
- Much as a surgical team during surgery is led by one surgeon performing the most critical work himself while directing his team to assist with or overtake less critical parts, it seems reasonable to have a "good" programmer develop critical system components while the rest of a team provides what is needed at the right time. Additionally, Brooks muses that "good" programmers are generally 5-10 times as productive as mediocre ones.
- Code Freeze and System Versioning
- Software is invisible. Therefore, many things only become apparent once a certain amount of work has been done on a new system, allowing a user to experience it. This experience will yield insights, which will change a user's needs or the perception of the user's needs. The system will therefore need to be changed in order to fulfill the changed requirements of the user. This can only occur up to a certain point, otherwise the system may never be completed. At a certain date, no more changes would be allowed to the system and the code would be frozen. All requests for changes will be delayed until the next version of the system.
- Specialized Tools
- Instead of every programmer having his own special set of tools, each team should have a designated tool-maker that may create tools which are highly customized for the job that team is doing, e.g., a code generator tool that spits out code based on a specification. In addition, system-wide tools should be built by a common tools team, overseen by the project manager.
- Lowering Software Development Costs
- There are two techniques for lowering software development costs that Brooks writes about :
- Implementers may be hired only after the architecture of the system has been completed (a step that may take several months, during which time prematurely-hired implementers may have nothing to do).
- Another technique Brooks mentions is not to develop software at all, but to simply buy it "off the shelf" when possible.