![]() |
|
|
#232 |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
hard part about this now is mostly with if 2 functions need to be embedded with each other later (I've already worked out how to print 2 functions one after the other but not inside each other).
oh and one step i missed to check for names that use underscore instead of space we'd need a way to turn all spaces into underscores I think it would just be a vector read and replace operation myself. Code:
if(v[i]==" ",v{i]=="_")
Last fiddled with by science_man_88 on 2010-08-11 at 14:36 |
|
|
|
|
|
#233 | ||
|
Aug 2006
135338 Posts |
Quote:
I think your first task should be #0: split the large tasks #2 and #3 into smaller subtasks (5-10 tasks each, if you can manage). Quote:
Yes, that would work, and the resulting vector can be concatenated back to a string. But if you start with a string "What are the first 10 Mersenne primes?" you don't really want to call the function What_are_the_first_10_Mersenne_primes, but rather something like firstMersenne(10). It's not an easy problem by any means! Last fiddled with by CRGreathouse on 2010-08-11 at 14:49 |
||
|
|
|
|
|
#234 | |
|
"Forget I exist"
Jul 2009
Dumbassville
26×131 Posts |
Quote:
Last fiddled with by science_man_88 on 2010-08-11 at 14:56 |
|
|
|
|
|
|
#235 |
|
Aug 2006
3·1,993 Posts |
Either name would be fine. I'm just saying that you don't want a new function name for every English sentence -- there are too many valid sentences. (There are maybe half a million words in English. If you recognize 10,000 of those, and if only 1% of those are valid at a given point in the sentence, then there are 10^22 10-word sentences... writing one function per second, this would take 3 trillion lifetimes to finish.)
|
|
|
|
|
|
#236 |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
check modified post against vector of functions in database if it doesn't contain one of them or it still can't make sense of it all it's returns an error or questions respectively
Code:
first_Mersenne_Primes(n)=Mersenne_Primes(n) that's the problem we need the code to make the problem into something it can understand before handing it the reins. Last fiddled with by science_man_88 on 2010-08-11 at 15:12 |
|
|
|
|
|
#237 |
|
Aug 2006
3·1,993 Posts |
Really? I would expect it to be used only for reasonably large numbers. I've run it on all odd numbers below 10^10, for example, which is easily large enough to have trouble with roundoff.
|
|
|
|
|
|
#238 |
|
"Forget I exist"
Jul 2009
Dumbassville
838410 Posts |
well i showed how I'd break it down logically myself can we get the script to do the same.
|
|
|
|
|
|
#239 | |
|
May 2010
Prime hunting commission.
110100100002 Posts |
Quote:
Also: Improved the precision. For 1987021, there are ≈372006 bases which pass it as a pseudoprime. Last fiddled with by 3.14159 on 2010-08-11 at 15:28 |
|
|
|
|
|
|
#240 |
|
May 2010
Prime hunting commission.
24×3×5×7 Posts |
@Sm88: Did you define what the Mersennes are? (Or at least Mersenne_Primes(n)?)
@CRG: I found the weakness in your program: It depends on factoring n. What if n = something like 8929916458641913352287532945770212899164203997 * 4483710071772199066536995719064666355529706337783587 ? Your program is rendered useless unless n is easily factored. Last fiddled with by 3.14159 on 2010-08-11 at 15:37 |
|
|
|
|
|
#241 | |
|
Aug 2006
3×1,993 Posts |
Quote:
![]() Again, I don't see the point in roundtripping: more time, possible precision errors. |
|
|
|
|
|
|
#242 | |
|
Aug 2006
3·1,993 Posts |
Quote:
Edit: You edited this following quote into your above post, so I'll edit in my reply. The naive method would test all ~4e97 bases. Each base would require the calculation of b^(n-1) mod n. These take about a millisecond each, for a total of ~4e94 seconds or ~1e85 lifetimes. Factoring n, if it wasn't written as above, could be done in a few hours. Big win for 'my' method. Last fiddled with by CRGreathouse on 2010-08-11 at 15:43 |
|
|
|
|
![]() |
| Thread Tools | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Why do I sometimes see all the <> formatting commands when I quote or edit? | cheesehead | Forum Feedback | 3 | 2013-05-25 12:56 |
| Passing commands to PARI on Windows | James Heinrich | Software | 2 | 2012-05-13 19:19 |
| Ubiquity commands | Mini-Geek | Aliquot Sequences | 1 | 2009-09-22 19:33 |
| 64-bit Pari? | CRGreathouse | Software | 2 | 2009-03-13 04:22 |
| Are these commands correct? | jasong | Linux | 2 | 2007-10-18 23:40 |