[QUOTE=Darwin226;33797127]Problem:
32 cards total, 4 different colors.
You are dealt 8 cards.
What are the chances of you getting all 8 red.
Approach 1:
Total number of combinations is around 165 ([URL="http://puu.sh/b1mL"]based on an online combinations calculator[/URL]) since the position of the color in the hand isn't important.
I don't see why any hand would be more likely to be dealt than any other hand so the chances should be 1/165.
There's obviously a MAJOR mistake somewhere in there since that's way to likely to happen than it actually is.
Approach 2:
Chances that the first card dealt is a red one are 8/32. Chances that the next one will also be red are 7/32... continue multiplication until 1/25.
This is what wolfram calculated
[url]http://www.wolframalpha.com/input/?i=product+x%2F%28x%2B24%29%2C+x+%3D+1+to+8[/url]
This is far more likely to be the correct solution but honestly, the first approach seems as logical to me as the second one.
To add programming to all this, I made a program that takes a deck and deals 8 cards, then dealt 10 million hands and recorded the results.
All cards were red only once! while the most popular shuffle was 2 of each color (around 50k times).
This is confusing the hell out of me.[/QUOTE]
After re-reading your question and attempting to edit my post for 10 minutes, approach 2 should be the correct one
[QUOTE=subenji99;33791600]That'll be because it's not capturing the full framerate per second but still playing it back at that speed.[/QUOTE]
Holly should be handling this... I think.
You just need to pass in how many seconds it's been since you last posted a frame. It works for variable frame rates for me in GMod.. What does your Video->AddFrame call look like right now?
The FPS on this video varies between 20 and 30.
[vid]http://puu.sh/b25H[/vid]
[QUOTE=Darwin226;33797127]Problem:
32 cards total, 4 different colors.
You are dealt 8 cards.
What are the chances of you getting all 8 red.
Approach 1:
Total number of combinations is around 165 ([URL="http://puu.sh/b1mL"]based on an online combinations calculator[/URL]) since the position of the color in the hand isn't important.
I don't see why any hand would be more likely to be dealt than any other hand so the chances should be 1/165.
There's obviously a MAJOR mistake somewhere in there since that's way to likely to happen than it actually is.
Approach 2:
Chances that the first card dealt is a red one are 8/32. Chances that the next one will also be red are 7/32... continue multiplication until 1/25.
This is what wolfram calculated
[url]http://www.wolframalpha.com/input/?i=product+x%2F%28x%2B24%29%2C+x+%3D+1+to+8[/url]
This is far more likely to be the correct solution but honestly, the first approach seems as logical to me as the second one.
To add programming to all this, I made a program that takes a deck and deals 8 cards, then dealt 10 million hands and recorded the results.
All cards were red only once! while the most popular shuffle was 2 of each color (around 50k times).
This is confusing the hell out of me.[/QUOTE]
Wolfram|Alpha gave the right answer.
Approach 1 works if you use the correct formula for combinations and punch in the right values.
Think of approach 1 this way: you have a total amount of combinations and some amount of red combinations. In this case there's only one red combination (there are 8 red cards and you draw 8 cards). Just divide the amount of red combinations with the amount of total combinations to get the probability that one random combination is a red combination.
The total amount of combinations is n! / (k! * (n - k)!) where n is the amount of cards (32) and k is the amount of cards drawn (8).
[QUOTE=garry;33799355]You just need to pass in how many seconds it's been since you last posted a frame. It works for variable frame rates for me in GMod.. What does your Video->AddFrame call look like right now?[/QUOTE]
[code]encoder->Video()->AddFrame( elapsed/1000.0, Holly::ColorMode::RGB, ndata, NULL );[/code]
Where elapsed is a delta since the last frame.
[editline]19th December 2011[/editline]
In miliseconds.
[editline]19th December 2011[/editline]
Also, I'm rewriting my recorder for higher performance, it takes 7ms to get the image data from the X server, and convert it to a raw RGB stream.
I takes Holly ~30-40ms to convert to webm. So what I'm going to do is save the raw to a file, and then convert when it's all finished.
[QUOTE=Jawalt;33799389][code]encoder->Video()->AddFrame( elapsed/1000.0, Holly::ColorMode::RGB, ndata, NULL );[/code]
Where elapsed is a delta since the last frame.
[editline]19th December 2011[/editline]
In miliseconds.
[editline]19th December 2011[/editline]
Also, I'm rewriting my recorder for higher performance, it takes 7ms to get the image data from the X server, and convert it to a raw RGB stream.
I takes Holly ~30-40ms to convert to webm. So what I'm going to do is save the raw to a file, and then convert when it's all finished.[/QUOTE]
If elapsed is in milliseconds, then wouldn't [code]elapsed/1000.0[/code] be in microseconds?
[QUOTE=Jawalt;33799389][code]encoder->Video()->AddFrame( elapsed/1000.0, Holly::ColorMode::RGB, ndata, NULL );[/code]
Where elapsed is a delta since the last frame.
[editline]19th December 2011[/editline]
In miliseconds.
[editline]19th December 2011[/editline]
Also, I'm rewriting my recorder for higher performance, it takes 7ms to get the image data from the X server, and convert it to a raw RGB stream.
I takes Holly ~30-40ms to convert to webm. So what I'm going to do is save the raw to a file, and then convert when it's all finished.[/QUOTE]
I did a quick test.. variable frame rate does work.. check this out..
[vid]http://puu.sh/b2dT[/vid]
The frame rate should get lower as it goes on (watch the static box)
I put up some tweaks that might improve the accuracy slightly, but it's working for me... :/
garry, just a small correction to Holly: WIN32_LEAN_MEAN doesn't do anything, you want WIN32_LEAN_AND_MEAN (Platform_Win32.hpp)
Thanks, fixed
[QUOTE=calzoneman;33799737]If elapsed is in milliseconds, then wouldn't [code]elapsed/1000.0[/code] be in microseconds?[/QUOTE]
Why is this getting dumbs and disagrees? That sounds like a very plausible bug...
EDIT : Ahh shit, I guess I deserve those dumbs
Also, I re-declare myself as the master of unreadable code with this mess
[code][BITS 16]
[ORG 0x7E00]
jmp main
db 'BEER 1.0'
dw 0x0200
db 8
dw 0x0020
dw 0x0200
dw 29
db 0xF8
dw 0xC900
dw 63
dw 1
dd 0x00000200
dd 0x00000000
db 0x80
db 0x00
db 0x28
dw 0x00000000
db 'Main Drive', 0
db 'FAT16 '
main:
mov si, message
call printstr
mov si, a20
call printstr
mov al, 2
out 0x92, al
mov si, pic
call printstr
in al, 0x21
mov bl, al
in al, 0xA1
mov cl, al
mov al, 0x11
out 0x20, al ; Initialize command
call io_wait ; Give it some time
mov al, 0x11
out 0xA0, al
call io_wait
mov al, 0x20
out 0x21, al ; Offets
call io_wait
mov al, 0x28
out 0xA1, al
call io_wait
mov al, 0x04
out 0x21, al ; Wiring
call io_wait
mov al, 0x02
out 0xA1, al
call io_wait
mov al, 0x01
out 0x21, al ; Mode
call io_wait
out 0xA1, al
call io_wait
mov al, bl
out 0x21, al
mov al, cl
out 0xA1, al
mov si, protected_land
call printstr
mov word [gdtr], 23
mov dword [gdtr+2], gdt
lgdt [gdtr]
mov eax, cr0
or eax, 1
mov cr0, eax
mov ax, 0x10
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ss, ax
jmp 0x08:reload_cs
jmp $
printchar:
mov ah, 0x0E
mov bh, 0x00
mov bl, 0x07
int 0x10
ret
printstr:
.loop:
mov al, [si]
or al, al
jz .done
call printchar
inc si
jmp .loop
.done:
ret
io_wait:
nop
nop
ret
gdtr:
dw 0
dd 0
idtr:
dw 0
dd 0
gdt:
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0
db 0xFF
db 0xFF
db 0x00
db 0x00
db 0x00
db 0x9A
db 0xFF
db 0x00
db 0xFF
db 0xFF
db 0x00
db 0x00
db 0x00
db 0x92
db 0xFF
db 0x00
idt:
times 2048 db 0
a20: db 'Enabling A20...', 10, 13, 0
message: db 'Loading Neon', 10, 13, 0
pic: db 'Remapping PIC...', 10, 13, 0
protected_land: db 'Entering protected mode...', 10, 13, 0
loadingkernel: db 'Loading kernel...', 0
reload_cs:
[BITS 32]
mov ebx, isr_30
mov ecx, 0x30
call reg_int
mov word [idtr], 2048
mov dword [idtr + 2], idt
lidt [idtr]
mov ecx, 1999
clr:
mov eax, ecx
shl eax, 1
mov byte [0xB8000 + eax], 0
mov byte [0xB8001 + eax], 0x0A
loop clr
%comment
mov ax, 0x04
mov dx, 0x1CE
out dx, ax
mov ax, 0x00
mov dx, 0x1CF
out dx, ax
mov ax, 0x01
mov dx, 0x1CE
out dx, ax
mov ax, 1024
mov dx, 0x1CF
out dx, ax
mov ax, 0x02
mov dx, 0x1CE
out dx, ax
mov ax, 768
mov dx, 0x1CF
out dx, ax
mov ax, 0x03
mov dx, 0x1CE
out dx, ax
mov ax, 0x20
mov dx, 0x1CF
out dx, ax
mov ax, 0x04
mov dx, 0x1CE
out dx, ax
mov ax, 0x01
mov dx, 0x1CF
out dx, ax
xor ebx, ebx
lop2:
xor eax, eax
lop:
mov dword [0xA0000 + eax], 0x003CFF8A
mov dword [0xA0004 + eax], 0x00F8CF43
mov dword [0xA0008 + eax], 0x00FF80FF
add eax, 12
cmp eax, 0xFFFF
jl lop
inc ebx
mov ax, 0x05
mov dx, 0x1CE
out dx, ax
mov ax, bx
mov dx, 0x1CF
out dx, ax
jmp lop2
%endcomment
mov bl, 0x0A
mov eax, loadingkernel
call prints
jmp 0x08:0x8E00;
hang:
jmp $
isr_30:
iret
reg_int:
push edx
mov edx, idt
shl ecx, 3
add edx, ecx
mov word [edx], bx
mov word [edx+2], 0x8
mov byte [edx+4], 0
mov byte [edx+5], 0x8E
shr ebx, 16
mov word [edx+6], bx
pop edx
ret
printc:
push ecx
movzx ecx, word [cpos]
shl ecx, 1
mov byte [0xB8000 + ecx], al
mov byte [0xB8001 + ecx], bl
inc word [cpos]
pop ecx
ret
prints:
push ecx
.loop:
mov cl, byte [eax]
cmp ecx, 0
je .end
push eax
mov al, cl
call printc
pop eax
inc eax
jmp .loop
.end:
pop ecx
ret
cpos: dw 0
times 4096-($-$$) db 0[/code]
Total of 5 comments
[editline]19th December 2011[/editline]
Uh, what a pagestretcher, I though code tags had scrollbars
I was gonna move my pagestretcher code to pastebin but FP doesnt let me edit it
Fuck
[QUOTE=calzoneman;33799737]If elapsed is in milliseconds, then wouldn't [code]elapsed/1000.0[/code] be in microseconds?[/QUOTE]
Why are people agreeing with this?
1000ms = 1s
as in, 1000ms / 1000
[QUOTE=calzoneman;33799737]If elapsed is in milliseconds, then wouldn't [code]elapsed/1000.0[/code] be in microseconds?[/QUOTE]
-snip- google lied to me don't listen to me
Surely if it is delta time and expressed in milliseconds it would be. I don't play games at half a frame a second :v:
(Also *)
Oh hey I wonder what this commented out code section does--- OH GOD MY EYEES
[t]http://dl.dropbox.com/u/4838268/psyduck.png[/t]
Wanted to program at school today. I know they have Python on the school computers so I tried to run it on command prompt, but command prompt told me I wasn't an admin. I had to make a new text file and rename it .py (Something you should know, at my school right click is disabled) so the program would run then disappear, batch file magic I get it to not disappear. Still couldn't figure out a way to get to Idle since I couldn't right click.
Why school, why?
It also manages to royally fuck up a lot of resizing algorithms judging from the thumbnail :v:
[editline]19th December 2011[/editline]
Dammit you ninja
[QUOTE=Tobba;33801259]It also manages to royally fuck up a lot of resizing algorithms judging from the thumbnail :v:
[editline]19th December 2011[/editline]
Dammit you ninja[/QUOTE]
Sorry :C
[QUOTE=Tobba;33801239]Oh hey I wonder what this commented out code section does--- OH GOD MY EYEES
[t]http://dl.dropbox.com/u/4838268/psyduck.png[/t][/QUOTE]
[img]http://i55.tinypic.com/2chkzls.png[/img]
Are you a wizard
[QUOTE=synthiac;33801330]500ms / 1000ms = 0.5 MICROSECONDS
YEP[/QUOTE]
google lied to me
be constructive for like 5 days okay
[img]http://ace.haxalot.com/pictures/random/zscreen/Screenshot-2011-12-19_22.54.41.png[/img]
Getting there :D
Making a Pang clone with procedural graphics;
[img]http://i51.tinypic.com/dnomd3.png[/img]
[QUOTE=Robber;33800516]Why is this getting dumbs and disagrees? That sounds like a very plausible bug...[/QUOTE]
When I realized I had derped I honestly expected several disagrees and boxes and maybe 1 or 2 posts telling me I'm stupid, but it's actually quite funny to watch people squabble over a simple math error.
Also finished my game for the TDP005 course we had (Disregard the mumble overlay)
[img]http://ace.haxalot.com/pictures/random/zscreen/Not_Quite_Pacman_%28Debug%29_Built_at_Dec_19_2011_231501-2011-12-19_23.25.03.png[/img]
You can try it [url=http://ace.haxalot.com/projects/NQP.7z]here[/url] (Sorry, only windows version for the moment)
Launched another app today. Took about 5 days to do.
[url]http://itunes.apple.com/us/app/komocrowd-is-your-destination/id490026157?mt=8[/url]
[img]http://a4.mzstatic.com/us/r30/Purple/8c/ed/5c/mzl.gfsyvhbc.320x480-75.jpg[/img]
[img]http://a3.mzstatic.com/us/r30/Purple/b8/f1/3c/mzl.rkbqnvet.320x480-75.jpg[/img]
[img]http://a4.mzstatic.com/us/r30/Purple/9a/f5/e3/mzl.roktofrs.320x480-75.jpg[/img]
[img]http://a5.mzstatic.com/us/r30/Purple/85/30/17/mzl.vwemfyen.320x480-75.jpg[/img]
[img]http://a2.mzstatic.com/us/r30/Purple/63/ea/82/mzl.siluhzly.320x480-75.jpg[/img]
Basically allows you to check if a location is crowded at a particular time. You can also let others know if a place is crowded at a particular time.
[QUOTE=kankurou;33802640]Launched another app today. Took about 5 days to do.
-images-
Basically allows you to check if a location is crowded at a particular time. You can also let others know if a place is crowded at a particular time.[/QUOTE]
Nice. Where are you pulling crowd information from?
You still need to take time into UI research. It looks much better than your cloud app one though.
Also, don't launch too many apps at once. You have to support them all, and it can be a pain to support a bunch of them.
[QUOTE=kankurou;33802640]Launched another app today. Took about 5 days to do.
[URL]http://itunes.apple.com/us/app/komocrowd-is-your-destination/id490026157?mt=8[/URL]
Basically allows you to check if a location is crowded at a particular time. You can also let others know if a place is crowded at a particular time.[/QUOTE]
Argh, I have an android device.
Deferred rendering implantation for OpenSceneGraph 3.0:
[img]http://i44.tinypic.com/142xao8.png[/img]
[QUOTE=calzoneman;33802134]When I realized I had derped I honestly expected several disagrees and boxes and maybe 1 or 2 posts telling me I'm stupid, but it's actually quite funny to watch people squabble over a simple math error.[/QUOTE]
You can't imagine how stupid I felt when I read my post again just now.
Sorry, you need to Log In to post a reply to this thread.