Question: Consider the following Erlang function: mystery( 0 ) -> 2; mystery( 1 ) -> 3; mystery( N ) when N > 1 -> mystery( N

Consider the following Erlang function:

mystery( 0 ) -> 2;
mystery( 1 ) -> 3;
mystery( N ) when N > 1 -> mystery( N  1 ) * mystery( N  2 ).

Show what would be returned by the following function calls. If the call would never finish, just put Never finish.

  • mystery( 1 )
  • mystery( 2 )
  • mystery( 4 )
  • mystery( 6 )
  • mystery( -1 )

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!