Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Help making a possibility counter.
- vikkcd
- Scratcher
500+ posts
Help making a possibility counter.
I am working on a game which needs to count the possibilities of a string of 1-0 characters and length of 10000 digits.
EX: 101
001
010
Like this. I don't need the list of these possibilities but I need the amount. I tried to do 10000 digits but Scratch seems to be going reeeeaaaalll slow after 30. I left my laptop on all for 3 hours to let the project run but it only made it to 80. This is way too slow. Here is one main rule. The 1 can never touch another 1. Help would be appreciated Thanks!
EX: 101
001
010
Like this. I don't need the list of these possibilities but I need the amount. I tried to do 10000 digits but Scratch seems to be going reeeeaaaalll slow after 30. I left my laptop on all for 3 hours to let the project run but it only made it to 80. This is way too slow. Here is one main rule. The 1 can never touch another 1. Help would be appreciated Thanks!
Coder, Animator, Artist
Love Michael Jackson and OK GO music.
forever
Fold Origami
Listen to Michael Jackson and OK GO
Play guitar
end
- vikkcd
- Scratcher
500+ posts
Help making a possibility counter.
Oops just realized I needed to add my possib. counter.
https://scratch.mit.edu/projects/553202216
https://scratch.mit.edu/projects/553202216
Coder, Animator, Artist
Love Michael Jackson and OK GO music.
forever
Fold Origami
Listen to Michael Jackson and OK GO
Play guitar
end
- vikkcd
- Scratcher
500+ posts
Help making a possibility counter.
bump
Coder, Animator, Artist
Love Michael Jackson and OK GO music.
forever
Fold Origami
Listen to Michael Jackson and OK GO
Play guitar
end
- awesome-llama
- Scratcher
1000+ posts
Help making a possibility counter.
There would be a better way by making a mathematical formula so that you could just input a number and get the result from it. The problem is that you need to be pretty skilled to figure this one out. I already tried and could only get approximations (within 1-2 of the actual value for the first few numbers), but could not get any further.
Here's a different way to think about your problem: How many possibilities of those binary digits involve 1s next to each other? If you can find that, you can subtract it from the entire set of permutations for all arrangements.
Maybe that might help with finding a better way to solve this?
The only other thing I can say to start you off is that the total including all possibilities of 1s touching each other is y=2^x where x is the length and y is the total possibilities.
Here's a different way to think about your problem: How many possibilities of those binary digits involve 1s next to each other? If you can find that, you can subtract it from the entire set of permutations for all arrangements.
Maybe that might help with finding a better way to solve this?
The only other thing I can say to start you off is that the total including all possibilities of 1s touching each other is y=2^x where x is the length and y is the total possibilities.
Last edited by awesome-llama (July 18, 2021 14:05:01)
- vikkcd
- Scratcher
500+ posts
Help making a possibility counter.
Ok I see the logic here. I will try to get an equation from excel but if that fails I will try to tinker around with scratch
Coder, Animator, Artist
Love Michael Jackson and OK GO music.
forever
Fold Origami
Listen to Michael Jackson and OK GO
Play guitar
end
- Discussion Forums
- » Help with Scripts
- » Help making a possibility counter.