FORMULA CHALLENGE shortest wins !

erik.van.geit

MrExcel MVP
Joined
Feb 1, 2003
Messages
17,832
Hi, everyone !!
just a little idea

In this threadwe came up with some formulas to get a random character choosen from
a, b, c ... z, A, B, C, ... Z, 0, 1, 2 ... 9
so 62 possibilities

wouldn't it be nice to make a little sport of it :biggrin:

the one who generates the shortest formula, may launch the next formulachallenge

OBJECTIF
GENERATE randomly 1 LCASE or UCASE or INTEGER
rules:
1. formula in english
2. acurate = all characters must occur about as much as the others when formula is tested (for instance 20000 times, copied down or "evaluate"-macrotest)
3. posts must be generated within 7 days (168 hours) from now
4. no replies with comments about the other formulas
5. jury = moderators ?

what do you think ?

kind regards,
Erik
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
malcom said:
C. O. Jones said:
y would u suspect such a thing?
just curious..

coz he's using china flag..

That's very perceptive.
He/she also provided a link to a site that showed Chinese characters only, so I suppose he/she probably does have some connection with China - well worked out, malcom
 
Upvote 0
Appoloh,
You solution works to a degree, but it does not satisfy the requirement that each character appear with an equal frequency.

I pasted your formula down 30,000 rows.
The frequency of each letter was about 1.9% for each letter, while the frequency of each number was about 4.9%
 
Upvote 0
To:PA HS Teacher

You are right!

52 characters

=CHAR(INDEX({48,65,97}+RAND()*{10,26,26},RAND()*3+1))


To:malcom & C. O. Jones

Thanks for your care. I am Chinese and living in Xiamen. My Enlish is so poor to write more words to express my opinion. I hope to be accepted here. Thanks again.
 
Upvote 0
Hi apolloh,
You updated formula still does not cause each character to appear equally. With this version, each alphabetic character appeard about 1.27% of the time, while each numeric character appeard about 3.37% of the time.

Welcome to the Board!

It is already clear that you have a good mind for formulas, and I look forward to your future posts. Your English comes across very well. As a monolingual person, I am humbled by yours (and many others, Erik included) ability to convey your ideas in English. Thank you for joining the board!
 
Upvote 0
The appearing times of character is depended on the Rand()*3+1,I tested rand()*3+1 by myself and found it should be correct.

A Column formula=rand()*3+1 and specialpasted by values.

B1:B3={2,3,4}-0.0000000000001 means a range of {1-1.999999..., 2-2.999999..., 3-3.999999...}

C1:C3=Frequency(A:A,B1:B3) comfirmed with ctrl+shift+enter



Result of the test this time on C1:C3 is ={21572;21930;22034}

So the pecents of the appeard times of 0-9,A-Z,a-z should be {32.92%,33.46%,33.62%},with a similar equal frequency.


Thanks for your kindness. :)
 
Upvote 0

Forum statistics

Threads
1,214,999
Messages
6,122,645
Members
449,093
Latest member
Ahmad123098

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top