This paper deals with the optimization of sensor arrangement and feature selection for activity recognition of the people living alone with sensors. We suggest an algorithm which picks up from several thousand to millions of characteristic sensor reactions as feature candidates, and selects best feature combinations and corresponding sensor arrangements for classification with as small numbers of sensors and features as possible. This paper introduces two kinds of approach; one is making the sensor number as small as possible with quasi-maximized precision, and another is getting the globally maxmized precision with only needed sensors. We confirmed by a pyroelectric sensor system that this algorithm could get such solution by applying some sparse selection methods to the real life data.