Solution to SICP Exercise 1.25

Structure and Interpretation of Computer Programs

Solution to Exercise 1.25:

Both the original and Alyssa’s version of expmod give the same result, but Alyssa’s version has much poorer performance. Here is a table comparing times spent (in milliseconds) calculating fast-prime? with the two different versions:

Prime number Original Alyssa’s
1009 608 2937
1013 578 3094
1019 687 2877
10007 874 93900
10009 875 92301
10037 749 94035

Times for Alyssa’s version are much higher than those for the original. Why is that?

As I couldn’t figure out how to get DrScheme’s profiler to measure time spent in built-in procedures such as remainder and *, I have to guess where the inefficiency is.

The original expmod calculates its result incrementally, calling remainder many times on relatively small values. Alyssa’s expmod, on the other hand, builds up a huge intermediate value, which is then passed to remainder once. My guess: because the numbers have grown so large in Alyssa’s version, the built-in operations, remainder, *, and / are consuming much more time than they do in the original.

Moral of the story: arbitrary precision arithmetic can be expensive.

How to Pitch an Idea

Scott Burkun gives some advice on pitching ideas:

The best delivery advice I can offer is to make sure you spend some time preparing for a positive response. What happens if they say “That’s an interesting idea. What do you want from me?” Do you want money? Other resources? A change in the project plan? A feature added to the feature list? Know what the sequence of steps are after they agree you have a good idea and be ready to ask for them.

Stealthmode Partners

Stealthmode Partners:

Stealthmode Partners is an advocate and accelerator for entrepreneurs and intrapreneurs: a network of people and companies working together to help support and accelerate new initiatives – be they new or emerging growth companies or new directions, projects, or products within existing companies.

Angel Capital Association

The Angel Capital Association:

This fast-growing association brings together the 200 angel organizations in the United States and Canada to share best practices, network, and help develop data about the field of angel investing.

Their website offers some resources aimed at prospective angel investors, including book recommendations, research papers, and a Primer for Angel Investment in Canada. Entrepreneurs might find it useful for understanding the world of angel investing.

Advice for Startups

A List Apart offers some practical advice for startups:

Write a business plan. The most important thing you can do to prepare for starting and operating your own business. Developing a business plan requires a lot of time and energy, but it’s invaluable for one primary reason — it forces you to come to terms with your business idea.

A VC Calls it Quits

Howard Anderson, founder of the Yankee Group and co-founder of YankeeTek Ventures and Battery Ventures, writes:

Good-bye! We venture capitalists like to think of ourselves as giants striding across the technology landscape, showering money on terrific young entrepreneurs, adding value, creating jobs, nurturing real companies. We are financial samurai. But I am giving it up. Why?

His reasons include technology oversupply, lack of hype, and market rationality.

Stealth Startups Suck

Mark Fletcher, CEO of Bloglines, on webapp startups that keep their ideas secret:

Some people think that they need to stay in stealth mode as long as possible to protect their exciting new idea. I hate to break the news to you, but unless you’re Einstein or Gallileo, your idea probably isn’t new. I have this theory. The success of a web service is inversely proportional to the secrecy that surrounded its development. There are exceptions of course. But I also think this can be applied to other things. Segway, anyone?

Toxic Entrepreneurs

Venture Capital Journal on toxic entrepreneurs:

Stewart Alsop, a venture partner at New Enterprise Associates in Menlo Park, has worked with a number of ball-busters in his career, and he has become convinced that in frustratingly many cases the harder an entrepreneur is to like, the more ruthlessly successful he or she becomes. “I call it my asshole theory,” he says. “The bigger the asshole, the better they do,” he laughs.

Guy Kawasaki Interview

Forbes interviews Guy Kawasaki, author of The Art of the Start:

If merely telling someone your idea means that it can be ripped off, then you hardly have a defensible product. If secrecy is your main weapon, then it will be hard to find investors. By the way, what happens when you ship? Are you going to ask every customer to sign a nondisclosure too?