Re: I have problem with these functions!!
- To: mathgroup at smc.vnet.net
- Subject: [mg16274] Re: [mg16154] I have problem with these functions!!
- From: "Arnold Knopfmacher" <arnoldk at gauss.cam.wits.ac.za>
- Date: Fri, 5 Mar 1999 00:41:34 -0500
- Organization: CAM,University ofthe Witwatersrand
- Sender: owner-wri-mathgroup at wolfram.com
Here are possibilities for 2) and 3) below biggerthan[list_,number_]:=Select[list,#>=number&] mostcommon[list_]:= Select[a=Sort[{Count[list,#],#}& /@ Union[list]],First[#]==Last[a][[1]]&][[ 1,2]] mostcommon[{5,2,7,4,3,7,3,1,8,8}] 3 Arnold Knopfmacher > Date: Tue, 2 Mar 1999 01:13:07 -0500 > From: "mikael hellstrom" <mikael.hellstrom at swipnet.se> To: mathgroup at smc.vnet.net > Hello! Mabe you can help me?? > > 1) > I'm going to make a function that take a list, the number that are going in > the list, and the spot > there the nummer are going to place. The function are leaving the new list > as a result. > switchelement[list_,number_,place_] > > > 2) > This function should return the "most common" numbers in the list.(if two > numbers have same frecvence,the function should take the lower number.) > like this: mostcommon[list_] > > > 3) > biggerthan[list_,number_] > This funktion return a list with values bigger or equal with "number" > >