You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into this problem when doing HW2 for 267A (and I feel like it's now far enough from the HW to post!).
Consider this minimum-reproducible example:
using Dice
functionsame_door(door)
f =flip(0.5)
if door ==DistUInt8(0)
if f DistUInt8(0) elseDistUInt8(1) endelseif f DistUInt8(1) elseDistUInt8(0) endendend
door =discrete(DistUInt8,[1/2, 1/2])
println(pr(@dice(same_door(door))))
However, if I replace the inner if-else-end with the ifelse() function, I don't encounter the error:
using Dice
functionsame_door(door)
f =flip(0.5)
if door ==DistUInt8(0)
ifelse(f, DistUInt8(0), DistUInt8(1))
elseifelse(f, DistUInt8(1), DistUInt8(0))
endend
door =discrete(DistUInt8,[1/2, 1/2])
println(pr(@dice(same_door(door))))
I ran into this problem when doing HW2 for 267A (and I feel like it's now far enough from the HW to post!).
Consider this minimum-reproducible example:
This produces the following error:
However, if I replace the inner
if-else-end
with theifelse()
function, I don't encounter the error:other reproducibility details
I'm running:
The text was updated successfully, but these errors were encountered: