taith Posted November 22, 2008 Share Posted November 22, 2008 hey... i was just calculating some "simple" probability on my math based security... and... aparently its not so simple... short form 62*30!*62*31!*62*32!*62*33!*62*34!*62*35!*62*36!*62*37!*62*38!*62*39!*62*40! calculated out... thats 50586747561369659529427898714959185444864000000000*1264668689034241488235697467873979636121600000000*32427402282929268929120447894204606054400000000*853352691656033392871590734058015948800000000*23063586260973875483015965785351782400000000*640655173915940985639332382926438400000000*18304433540455456732552353797898240000000*538365692366336962722128052879360000000*16314111889888998870367516753920000000*509815996559031214698984898560000000*3795156301928272069719490560000000 from there, php calculates it to infinite... and ubuntu's calculator goes to 813665035487097739564052900973113854808099898446057214681902080707157946132672615577380971049336065952161071033555822795004021568792504911666911516290418519452277690486344017408982134857832375125016 which is obviously wrong (not divisible by 10, unlike the prior values)... anyone have a calculator that can calculate such absurdly high numbers? Link to comment https://forums.phpfreaks.com/topic/133829-not-so-simple-math-problem/ Share on other sites More sharing options...
genericnumber1 Posted November 22, 2008 Share Posted November 22, 2008 use the Bc Math library, it calculates numbers as strings, so answers can have a potentially limitless length. They are quite a bit slower than normal math though. http://us2.php.net/bc Link to comment https://forums.phpfreaks.com/topic/133829-not-so-simple-math-problem/#findComment-696505 Share on other sites More sharing options...
taith Posted November 22, 2008 Author Share Posted November 22, 2008 use the Bc Math library, it calculates numbers as strings, so answers can have a potentially limitless length. They are quite a bit slower than normal math though. http://us2.php.net/bc potentially is right... i didnt even know they existed THANKS! if you wanted to know... it returned to a chance of 1 in 8136650354870977395640529009731138548080998984460572146819020807071579461326726155773809710493360659521610710335558227950040215687925049116669115162904185194522776904863440174089821348578323751250169567284370740210436552533589035648782408122229136327260717040309270543913129533866009036478940137705645645817253059961713589113147849546433474284955339391514746837563446514417664000000000000000000000000000000000000000000000000000000000000000000000000000000000000 Link to comment https://forums.phpfreaks.com/topic/133829-not-so-simple-math-problem/#findComment-696508 Share on other sites More sharing options...
Mchl Posted November 22, 2008 Share Posted November 22, 2008 Did you really need so exact result. Wouldn't 1 to 8.1E459 be enough? Link to comment https://forums.phpfreaks.com/topic/133829-not-so-simple-math-problem/#findComment-696513 Share on other sites More sharing options...
genericnumber1 Posted November 22, 2008 Share Posted November 22, 2008 who DOESN'T care about at least 376 significant figures? Link to comment https://forums.phpfreaks.com/topic/133829-not-so-simple-math-problem/#findComment-696516 Share on other sites More sharing options...
taith Posted November 22, 2008 Author Share Posted November 22, 2008 who DOESN'T care about at least 376 significant figures? EXACTLY! Link to comment https://forums.phpfreaks.com/topic/133829-not-so-simple-math-problem/#findComment-696519 Share on other sites More sharing options...
Mchl Posted November 22, 2008 Share Posted November 22, 2008 Engineers But ok. I can understand. Sometimes I do such things myself. Besides, you;ve learned something along the way, and that's always good. Link to comment https://forums.phpfreaks.com/topic/133829-not-so-simple-math-problem/#findComment-696522 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.